Conditional validation - is it possible? How?

sinemac 31 Oct, 2007
Is it possible to do conditional validation?

The form I have here:
http://www.headgutcheck.com/score_your_session
has five "groups" of input, consisting of a text field and 10 pairs of radio buttons.

What I'd like to do is make it so that IF data is input into a text field, THEN all 10 radio button questions are required.

Is this possible? Is it possible within the ChronoForms system?

If yes, how would I do it?
Max_admin 31 Oct, 2007
Hi sinemac,

Iam really not sure if its possible, You can look at the FAQ written by Bob about the easy validation system and go to the validation script homepage to see if there is any clues!

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
sinemac 31 Oct, 2007
Hi Max,

I'm afraid I know next to nothing in terms of javascript, so looking over what I've been able to find so far isn't leading to much progress.๐Ÿ˜Ÿ

I was hoping it wouldn't be too difficult to implement.๐Ÿ˜‰ But without the javascript knowledge, I think I'll end up taking way too much time for this particular project since I'll have to figure out the basics at the same time.๐Ÿ˜Ÿ
magli 31 Oct, 2007
It is definitely possible. You are right though, it requires playing around with javascript. The key to it is adding "disabled" to the radio buttons, and then using a simple script to enable the ones you want according to which text field has been filled out.

Here are some leads in case you decide to do it:
http://javascript.about.com/library/bldisable.htm
http://www.activejump.com/m-7.shtml

Google finds loads of related articles:
http://www.google.com/search?hl=en&client=firefox-a&rls=com.ubuntu%3Aen-US%3Aofficial&q=disable+enable+radio+buttons&btnG=Search

You may find someone who provides exactly what you are looking for.
Max_admin 31 Oct, 2007
Hi Magli,

Thank you, sure its possible with some javascript but I was not sure if it can be implemented easily with the js library we are already using for validation๐Ÿ˜‰

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.