| Author |
Validating a JSP
|
Hari Dhanakoti
Ranch Hand
Joined: Jan 07, 2008
Posts: 74
|
|
Hi, I am using a sample jsp page to work on the javascript validation. My form components resembles as such... If i access form components as such then it gives alert as undefined. If i access form components as such then it gives alert with the first component value. What should i do for validating the jsp...
|
Regards,
Hari
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
hi, 1) there is a loop right so every time same name onlt asigned to the input tag ..so if you want to take 2 nd value use --------------------------------------------------- alert(document.validForm.first1[1].value);...etc ------------------------------------------------------ 2) if you want to use getElementById then you have to set new name for every iteration ...because if you want to use getElementById then field name should uniqu other wise it will give first matching value ........ hint:
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
|
what happend ? post is lengthy!(big wide)
|
 |
Hari Dhanakoti
Ranch Hand
Joined: Jan 07, 2008
Posts: 74
|
|
Hi seetharaman , Thanks for your reply. The above mentioned case works well with checkboxes. Incase of using the radio buttons i would like to have a unique name to represent. So how do i handle it in case of radio buttons. Any suggestions?
|
 |
Hari Dhanakoti
Ranch Hand
Joined: Jan 07, 2008
Posts: 74
|
|
Hi, I got the things working... Thanks for your reply.
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
you are welcome
|
 |
 |
|
|
subject: Validating a JSP
|
|
|