hi,
i created one jsp page..in it i used check boxes as well as textboxes..i need to check both the check boxes and textboxes..i tried it but it is validating only the check box not the textbox..here is the code can anyone help me out...
login.jsp
login.js--javascript code
Thanx in advance,
nd waiting for the reply
madhu.
i created one jsp page..in it i used check boxes as well as textboxes..i need to check both the check boxes and textboxes..i tried it but it is validating only the check box not the textbox..here is the code can anyone help me out...
login.jsp
Code:
<td><font color="#800000" size=""><b>Low-Bal</b></font></td>
<td><input type="checkbox" name="balrdys" value="F,">Fresh A/c <input type="text" name="balrdys" size="1"><br>
<input type="checkbox" name="balrdys" value="A,">Renewal <input type="text" name="balrdys" size="1"><br>
<input type="checkbox" name="balrdys" value="NO">No<br>
<td></td>
Code:
var chkBalrdays = document.getElementsByName('balrdys');
var hasBalrdaysChecked = false;
for (var j = 0; j < chkBalrdays.length; j++)
{
if (chkBalrdays[j].checked)
{
hasBalrdaysChecked = true;
if (document.frm.balrdys.value == "")
{
alert("Enter Bal-R-Days");
document.frm.balrdys.focus();
return (false);
}
break;
}
}
if (!hasBalrdaysChecked)
{
alert("Please select at least one Low BalRDays");
return false;
}
nd waiting for the reply
madhu.
Comment