• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Two Email Fields: Eitheof them as required field ?

Two Email Fields: Eitheof them as required field ? 9 years 4 months ago #33289

  • dietze
  • dietze's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Hello there!

Long:
I have a registration form where the user is able to add his personal and his business contact. Both fieldsets have an email field. And one of them has to be required; alternatively. For example i dont want to give my private address but my business address. Or the other way around. But the user should not be able to leave both of them empty. Is this possible?

Short:
Email-field-1
Email-field-2
Either of them has to be required alternatively! How?

Thanks a lot for your help!
Martin
The administrator has disabled public write access.

Two Email Fields: Eitheof them as required field ? 9 years 4 months ago #33294

On the right side of your form in the create/design section (back-end obliviously) , you will see a column that says "required".

IT should either have a green ceck mark or a red circle with a slash. just click that to enable or disable the required field.
The administrator has disabled public write access.
The following user(s) said Thank You: dietze

Two Email Fields: Eitheof them as required field ? 9 years 4 months ago #33295

  • dietze
  • dietze's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Thank you for your reply. Of course i could mark one of these fiels as a required field. But thats not what i was trying to do. I wanted my users to be free which of the two email fields he will use. but he has to use a least one.

Thanks to the support team i managed my issue by a few simple php code lines in the "Scripts Called On From Process". There i added both fields to $invalid if both are empty. Further both fields has to be marked as not required. But of course i had to add a hint for my users.
The administrator has disabled public write access.

Two Email Fields: Eitheof them as required field ? 5 years 1 month ago #39956

  • peter52
  • peter52's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 65
  • Thank you received: 3
Can You post the script You added?
The administrator has disabled public write access.

Two Email Fields: Eitheof them as required field ? 5 years 1 month ago #39975

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

Without any script whatsoever, you can use the conditional fields feature among these steps:

- use a radio group with 2 or 3 selections/items as needed (one for an email textbox, the second one for the other email textbox, and the third one for both textboxes).

- add these email textboxes to your form and make them both required.

- use the conditional fields feature to show/hide your email textboxes based on the radio group choices.

The conditional fields feature is specially designed to allow form submit even if the field is required, as long as it remains hidden through such a condition.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!