Conditional Field with info required

  • Cpointcc
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 123
  • Thank you received: 0

Cpointcc created the topic: Conditional Field with info required

I am looking to have an option field for phone or email. If choice is phone, then a text box appear to include phone number.
#236482
  • Posts: 2478
  • Karma: 86
  • Thank you received: 333

mihaela replied the topic: Conditional Field with info required

Hello,

That can be easily done.

You can either create your form with both a field to enter email and a field to enter the phone. Then you would use a custom validation script which would check whether at least one of these fields is filled in.

Another option if you wish for the phone field to show if a checkbox is checked, you could use visibility rules to show/hide the text box to include a phone number as explained here crosstec.org/en/support/online-documenta...f-conditionally.html .

In that case, you can just set validation script FF::ff_valuenotempty for this textfield form elements crosstec.org/en/support/online-documenta...g-form-elements.html .

It would be required only if it is turned on in the moment of submitting.

Let me know whether you have managed to set this for your form.
If you have more questions regarding this feel free to ask.

Regards,

Mihaela
#236489
  • Cpointcc
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 123
  • Thank you received: 0

Cpointcc replied the topic: Conditional Field with info required

I am still having trouble. I have the fields set up based on the first link above. However, it isn't opening up the phone text box if you choose the phone option. (I actually imported the test file that was the example).

Do I need to set the valuenotempty

www.peru.il.us/askthecity

Visibility rules:

turn on element bfQuickMode4241733 if bfQuickMode72431 is on
turn off element bfQuickMode4241733 if bfQuickMode72431 is off

See attached screenshots.


Clearly I'm missing something...

I appreciate your help and feedback!
#236504
Attachments:
  • Posts: 2478
  • Karma: 86
  • Thank you received: 333

mihaela replied the topic: Conditional Field with info required

Hello,

I see where is the problem. You haven't written the visibility rules correctly for your case.

Please use this visibility rules instead:
turn off element bfQuickMode4241733 if bfQuickMode72431 isnot phone
turn off element EMAILFIELDNAME if bfQuickMode72431 isnot email

turn on element bfQuickMode4241733 if bfQuickMode72431 is phone
turn on element EMAILFIELDNAME if bfQuickMode72431 is email
JUST replace EMAILFIELDNAME with the Name of the email field.

The FF::ff_valuenotempty script you need to set for validations of the phone and email fields if you want them to be required.

Let me know whether it works after this changes.

Regards,

Mihaela
#236533
  • Cpointcc
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 123
  • Thank you received: 0

Cpointcc replied the topic: Conditional Field with info required

Yes, that is perfect!

There is a small problem. The response is not showing up on the mailback or in the database.

My question: I don't understand why you have to add the extra is not phone, is not email if the field name is already there.

Please advise.
#236541
  • Cpointcc
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 123
  • Thank you received: 0

Cpointcc replied the topic: Conditional Field with info required

Hello,

This is working fine now on the front, but the email back form is not working. It doesn't show the field data in the email or in the database. Here are my settings on the email:

Follows is a recent inquiry from the Ask the City from the website

{bfQuickMode67034:label}:  {bfQuickMode67034:value}

{bfQuickMode2771689:label}:

{bfQuickMode2771689:value}

From:{bfQuickMode1597386:label}:  {bfQuickMode1597386:value}

{bfQuickMode5956614:label}:  {bfQuickMode5956614:value}

{bfQuickMode4931602:label}:  {bfQuickMode4931602:value}

{bfQuickMode72431:label}: {bfQuickMode72431:value}

{bfQuickMode4241733:label}:  {bfQuickMode4241733:value}

{bfQuickMode6990604:label}:  {bfQuickMode6990604:value}

Please respond to your inquiry as quickly as possible.


Please advise on how to make that show up.
#236544
Moderators: ForumSupporttomeperica
Time to create page: 0.296 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here