Hi,
i have an array of 19 checkboxes as follows:
<% dim temp_id(19)
for i=0 to 18
temp_id(i) = "id" & i
next
for j=0 to 18 %>
<input type="text" name="<%=temp_id(j)%>" size=15 maxlength="20">
<% next %>
As shown, each checkbox has a unqiue name (eg. id1, id2, ..)
Thus I wonder in JS, how can i validate all the checkboxes?
say,
if (form.id1.value.length == 0)
{
alert("Empty field not allowed"
;
form.id1.focus();
return false
}
I do not want to repeat this 19 times as i want to use arrays.. However, the form name for the checkboxes are in
<%=temp_id(j)%> this format, how can i do the validation? Pls help, thanx!
i have an array of 19 checkboxes as follows:
<% dim temp_id(19)
for i=0 to 18
temp_id(i) = "id" & i
next
for j=0 to 18 %>
<input type="text" name="<%=temp_id(j)%>" size=15 maxlength="20">
<% next %>
As shown, each checkbox has a unqiue name (eg. id1, id2, ..)
Thus I wonder in JS, how can i validate all the checkboxes?
say,
if (form.id1.value.length == 0)
{
alert("Empty field not allowed"
form.id1.focus();
return false
}
I do not want to repeat this 19 times as i want to use arrays.. However, the form name for the checkboxes are in
<%=temp_id(j)%> this format, how can i do the validation? Pls help, thanx!