Form Validation Help
Ok, where is what I'm trying to do. I have a classic ASP form that pulling in an XML document with a list of question on it. Each question is a Yes/No radio button. If No is checked then a TextArea will appear next to the question. What I looking for is a validation method to check all the "NO" Replies and if "NO" is checked[1] then it would validate the Textarea for that question for a alpha 5 char entry. I have search the web and found alot of information on this subject. But here is the twist to it, most examples are knowning what the check boxes names are. In this case the XML is generated by the End-use/Admin so question numbers can very. So what I have done is group the question by group and then by count. So radio Yes/No will always have the name value of Answer_GroupNumber_QuestionNumber ie Answer_0_0 for group 0 and question 0 and for Comments if would be Comment_GroupNumber_QuestionNumber which will give it the same Comment_0_0 for the first comment. What I'm guessing is that I will have to do a getElementsByID and do a split name for both the radio buttons and the textarea. but kind of unclear about doing split names in javascript. Any information would be greatly helpfull.
Cheers,
Jonsey
|