Form Help

TOPIC:

Validate field "Number & String" required 1 year 5 months ago #253052

  • Topic Author
  • Scolex
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 12
  • Thanks: 0
Hi there,
my issue is that I need a validation of field where it is requried that a number and a string is set, F.e. "5 Pieces".

How can I do that?
Thanks for help.
function ff_bfQuickMode73712_validation(element, message)
{
    if (element_fails_my_test) {
        if (message=='') message = element.name+" faild in my test.\n"
        ff_validationFocus(element.name);
        return message;
    } // if
    return '';
} // ff_bfQuickMode73712_validation

Please Log in or Create an account to join the conversation.

Validate field "Number & String" required 1 year 5 months ago #253054

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 10535
  • Karma: 3
  • Thanks: 705
Hi,

go to your element->Properties->Validation->check Custom and put this:
function ff_nameofyourelement_validation(element, message)
{
var pattern=/[a-zA-Z0-9]$/;
    if (pattern.test(element.value)) return '';
        if (message=='') message = element.name+" faild in my test.\n"
        ff_validationFocus(element.name);
        return message;

} // ff_nameofyourelement_validation
Please replace nameofyourelement with name for your element (not title)

Let me know if you need more help

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Validate field "Number & String" required 1 year 5 months ago #253055

  • Topic Author
  • Scolex
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 12
  • Thanks: 0
Thanks for your help, but that doen't work as thought. If I put just a number in, the validation passes... I need the combination ogf "number AND string".

Best regards

Please Log in or Create an account to join the conversation.

Validate field "Number & String" required 1 year 5 months ago #253056

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 10535
  • Karma: 3
  • Thanks: 705
Hi,

then like this:
function ff_nameofyourelement_validation(element, message)
{
var pattern=/[a-zA-Z]/;
var pattern1=/[0-9]/;
    if (pattern.test(element.value) && pattern1.test(element.value)) return '';
        if (message=='') message = element.name+" faild in my test.\n"
        ff_validationFocus(element.name);
        return message;

} // ff_nameofyourelement_validation

Let me know if it works ok for you

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Validate field "Number & String" required 1 year 5 months ago #253113

  • Topic Author
  • Scolex
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 12
  • Thanks: 0
Works fine!
Thanks!!!!

Please Log in or Create an account to join the conversation.

Validate field "Number & String" required 1 year 5 months ago #253120

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 10535
  • Karma: 3
  • Thanks: 705
Hi,

super! :)

Please keep us motivated by leaving a small review here:
extensions.joomla.org/extension/contacts...orms/breezing-forms/
(Please turn off your VPN and local Apache prior reviewing as your review might get blocked)

Much appreciated!

Thanks & regards,
Tihana

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.050 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!