我正在编写一个程序,在其中我从数据库中检索数据,并在结果集中获得n行数。基于我已动态生成每行的复选框的行数。现在我想验证这种形式,场景就像这样“如果用户没有选中任何复选框”程序应该生成错误(警报)。我想要js功能。
while(disciterator.hasNext())
{
temp=(String)disciterator.next().toString() ;
st= new StringTokenizer(temp,"$");
enrollment_no = st.nextToken();
ExamBean examb = new ExamBean(dbConnVar);
personal_details=examb.getPersonalDetails(enrollment_no);
if(!(personal_details.isEmpty()))
{
st=new StringTokenizer(personal_details,"$");
firstName1 = st.nextToken();
lastName = st.nextToken(); //
address = st.nextToken();
phone = st.nextToken(); //
email = st.nextToken(); //
gender = st.nextToken();
mothers_name = st.nextToken(); //
fathers_name = st.nextToken(); //
temporary_address =st.nextToken();
}//end if
else
{
}
%GT;
<tr>
<td class="MTTD8" align="center"><input type="checkbox" name="MigrationCHK" id="MigrationCHK" value="<%=enrollment_no%>" onclick="uncheckSelectAll()"></td>
<td align="center" class="MTTD2" > <font size=2> <%=enrollment_no%> </font></td>
<td class="MTTD2" > <font size=2><%=firstName1%> <%=lastName %></font></td>
<td class="MTTD2" ><font size=2><input type="text" name="<%=i%>mcno" /></font></td>
</tr>
<%
i++;
}
%>