TOPIC:

validate multiple input-fields with one hidden input-field 3 years 5 months ago #225816

  • Topic Author
  • rehazentrumbb
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 29
  • Thanks: 2
Hello support!

we got 2 input-fields (phone & email) on one page and want to validate if one of these input-fields got some value like:
Phone & Email filled = true
Phone filled = true
Email fille = true
Phone & Email not filled = false

Our current idea is a solution like in this thread - just with input-fields instead of radio-groups but we can't get it to work :(
crosstec.org/en/forums/41-breezingforms-...ust-with-groups.html

Maybe there's an "easier" solution.

Thanks in advance!

David

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

validate multiple input-fields with one hidden input-field 3 years 5 months ago #225832

  • marko.bosnjak
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 2222
  • Karma: 44
  • Thanks: 279
Hello David,

here's a solution.
There are 2 textfields named "phone" and "email". Go to the "phone" element > Validation > Type > Custom > Insert Error Message and paste this code in the framework:
function ff_phone_validation(element, message)
{
if ((ff_getElementByName('phone').value != '') || (ff_getElementByName('email').value != '')) {
   return '';  
}
else {
   if (message=='') message = element.name+" faild in my test.\n"
   ff_validationFocus(element.name);
   return message;
}
}
Basically, the script checks if both fields are empty. If so, the validation message will come up. If not, the form will submit.

I'll attach you the form. Install it and check it out.
Let me know if it works for you.

Regards,
Marko
======================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
======================================
Need to renew Pro Support?
Buy Here!
======================================
Satisfied?
Consider a Membership!
======================================
Follow us on Facebook!
Attachments:
The following user(s) said Thank You: rehazentrumbb

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

Last edit: Post by marko.bosnjak.

validate multiple input-fields with one hidden input-field 3 years 5 months ago #225842

  • Topic Author
  • rehazentrumbb
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 29
  • Thanks: 2
Hello Marko,

thank you so much for your excellent and fast answer!
Worked perfectly! :)

Best wishes

David

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

validate multiple input-fields with one hidden input-field 3 years 5 months ago #225843

  • marko.bosnjak
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 2222
  • Karma: 44
  • Thanks: 279
Awesome! :woohoo:
You're welcome.
Let us know if you need anything else.

Regards,
Marko
======================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
======================================
Need to renew Pro Support?
Buy Here!
======================================
Satisfied?
Consider a Membership!
======================================
Follow us on Facebook!

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

Last edit: Post by marko.bosnjak.
  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.047 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!