Hi,
propably this is an easy one but I could not find a solution until now:
I have 2 dropdown fields in a form.
Example:
Field 1 contains "Apple", "Banana", "Tomato"
Field 2 contains "Box", "Basket"
Now, every combination is selectable by default. What I would like to accomplish is, that 1 specific combination is not allowed / selectable, or at least that the form cannot be sent and I get a error message.
Example:
Field 1 = "Banana" & Field 2 = "Box" is not an allowed combination and should not be accepted.
Question:
- How can I do something like that?
- Do I need to use a specific (different) field type ?
- Or is the only way to check for these values when the "Send"-Button is clicked ?
Thanks for pointing me in the right direction.
BR Hupi
Question for the Formbuilder - Professionals
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Question for the Formbuilder - Professionals
The simplest way to handle this would probably be some javascript in the form template.
Otherwise, you would need a UDT to do the validation and throw an error.
Otherwise, you would need a UDT to do the validation and throw an error.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Question for the Formbuilder - Professionals
Not exactly the same but it might help you: http://tinyurl.com/yy9k6e5a
The 'THEMA' (theme) dropdown is only filled after selecting a 'DATUM' (date). Also, if the selected date is changed, the theme dropdown is updated and a new selection needs to be made.
That's an example with javascript and calguy's module CGBetterForm. I think it can be done with FormBuilder too.
Javascript validation is nice but if you absolutely don't want 'malicious' orders in your backed you must do server side validation too (I do it in this case).
Look at the page's source and the linked res_form.js to understand what's happening (probably can be improved).
I think I generate the javascript themes and eventdates vars from within a LISE instance. But could be a UDT as well.
The 'THEMA' (theme) dropdown is only filled after selecting a 'DATUM' (date). Also, if the selected date is changed, the theme dropdown is updated and a new selection needs to be made.
That's an example with javascript and calguy's module CGBetterForm. I think it can be done with FormBuilder too.
Javascript validation is nice but if you absolutely don't want 'malicious' orders in your backed you must do server side validation too (I do it in this case).
Look at the page's source and the linked res_form.js to understand what's happening (probably can be improved).
I think I generate the javascript themes and eventdates vars from within a LISE instance. But could be a UDT as well.
Re: Question for the Formbuilder - Professionals
Hi friends,
ok, thanks for your inputs. Will try to sort that out and - in case I find a good way - post the solution here.
Well ... it may take a while since its not exactly urgend but will stay on it.
BR
Hupi
ok, thanks for your inputs. Will try to sort that out and - in case I find a good way - post the solution here.
Well ... it may take a while since its not exactly urgend but will stay on it.
BR
Hupi