If the form is submitted with errors, I want the page to refresh with the radio button that was chosen to again be selected.
In the response, I am returning the value of the selected radio button. I use Java to process the request variable, and call Javascript to set the radio button...
Everything works fine except for setting the radio button. I have an alert that displays "here" when the "male" button value is returned. So I know that the code is getting to that point.
I must not be properly setting the radio button. Am I not properly finding it in the fieldset?
The way I fixed it was to simply move the JSP code (with the Javascript) to the bottom of the page. Once all the page elements are loaded, the code works fine.
Thanks for the tip.
I guess I could also put the code in the $(document).bind('pageinit') method to make sure it runs after the page is loaded.
Leave a comment on edcincy's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic