Help with radio/textbox

wxdqz

New Member
On this page (<!-- m --><a class="postlink" href="http://www.planetjk.com/report_error.shtml">http://www.planetjk.com/report_error.shtml</a><!-- m -->) I want to create a JS alert that will force the user to enter data into the "Other Details" box if they choose the "Other" radio button under 'Type of Error'.

The problem is that I'm using a cgi script to validate this form, and I can't dynamically change the required status of the "other details" box.

Would this work?
1)Set the "Other Details" box as required, causing the CGI to validate data
2)For the "Other details" TEXTAREA box, use a value of "_" to bypass the CGI validation under normal conditions
3)Use JS to clear out any data in the "Other details" TEXTAREA box ONLY IF the user chooses the 'Other' Radio button, causing the CGI to prompt the user to enter info into the "Other Details" TEXTAREA box?

If that would work, does anyone have any suggestions on the JS code?

I'd rather do it with an Alert box telling the user "You entered your Type of Error as Other; Please specify this error in the 'Other Details' box" but I'm not sure if an Alert box is compatible with the CGI validation.

Thanks in advance...
 
Back
Top