Errol Farro
asked on
Coldfusion: Block certain fields based on input field
I have a form with 7 fields (fields 1 thru 7). If field1=A, fields 2, 3 and 4 should be blocked and fields 5, 6 and 7 can be entered. If field1=B, the other side around, fields 2, 3 and 4 can be entered and fields 5,6 and 7 blocked.
How can I accomplish this in coldfusion?
Thanks.
Errol
How can I accomplish this in coldfusion?
Thanks.
Errol
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also remember validate on server side as java script can be easily disabled and you can't do anything about it. In case something is invalid, return to the page with an error message.
ASKER
I tried your code and it worked fine with the radio button but actually I have a drop down list with 5 values.
If the field is value1 then it should do part 1, else it should do part 2. I don't know scripting very well. How do I do I change the if line ( if (document.form1.radio1[0]. checked==t rue)) to handle a drop down field?
Thanks. Errol
If the field is value1 then it should do part 1, else it should do part 2. I don't know scripting very well. How do I do I change the if line ( if (document.form1.radio1[0].
Thanks. Errol
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hey,
Doh, had a busy morning @ work but yep, what mihaimm put should work for a drop down.
~Stu :-)
Doh, had a busy morning @ work but yep, what mihaimm put should work for a drop down.
~Stu :-)
ASKER
Thanks a lot for your help Guys. It's working. Regards. Errol