The question is on the client side validation using java script.
Significant parts of the program related to the question are given below..
...
<form name="results" action="" method="post">
...
<input type="radio" name="id" value="<%= id_edit %>" /> <!-- Don't bother about id_edit -->
....
<input type="button" name="Edit" value="Edit" onclick="invoke(0)"><input type="button" name="Delete" value="Delete" onclick="return invoke(1)">
....
The script,
function invoke(btn)
{
if(btn == 0) document.results.action="gev.do";
if(btn == 1) document.results.action="del.do";
document.results.submit();
}
What basically i do is, depending on the selection of button, i pass a value to the servlet, either for updation or deletion.
My question is, how can i validate the radiobutton, ie, i can any one help me out writing the js to validate if any one of the radio button is selected.
All my efforts are in vein and i now use server side validation.