luana.neri80
25-05-2003, 14:33
non riesco a far funzionare il checkbox.
devo selezionare UNO o PIU' INTERESSI e metterli in un DB, se sono tutti selezionati funziona, se uno dei 4 checkbox è spento ricevo l'errore:
ClassNotFoundException: null
ecco il listato:
1^pagina:
<FORM action="file1.jsp" method="post">
<tr>
<td>Interest :</td>
<td>
<input type=checkbox name=INTEREST0 value=Anthropology> Anthropology
<input type=checkbox name=INTEREST1 value=Astronomy> Astronomy
<input type=checkbox name=INTEREST2 value=Business> Business
<input type=checkbox name=INTEREST3 value=Politics> Politics
<input type=checkbox name=INTEREST4 value=Sport> Sport
</td>
</tr>
<Tr>
<INPUT type="submit" value="insert">
<INPUT type="Reset">
</Tr>
</FORM>
2^ pagina
<%...........
String interest =new String();
for(int i=0;i<5;i++)
{
String interestI = new String(request.getParameter("INTEREST" + i));
if(!interestI.equals(null))
{
interest += " " + interestI;
}
}
out.println(interest);
%>
grazie per l'aiuto, volenteroso navigante! :cry:
devo selezionare UNO o PIU' INTERESSI e metterli in un DB, se sono tutti selezionati funziona, se uno dei 4 checkbox è spento ricevo l'errore:
ClassNotFoundException: null
ecco il listato:
1^pagina:
<FORM action="file1.jsp" method="post">
<tr>
<td>Interest :</td>
<td>
<input type=checkbox name=INTEREST0 value=Anthropology> Anthropology
<input type=checkbox name=INTEREST1 value=Astronomy> Astronomy
<input type=checkbox name=INTEREST2 value=Business> Business
<input type=checkbox name=INTEREST3 value=Politics> Politics
<input type=checkbox name=INTEREST4 value=Sport> Sport
</td>
</tr>
<Tr>
<INPUT type="submit" value="insert">
<INPUT type="Reset">
</Tr>
</FORM>
2^ pagina
<%...........
String interest =new String();
for(int i=0;i<5;i++)
{
String interestI = new String(request.getParameter("INTEREST" + i));
if(!interestI.equals(null))
{
interest += " " + interestI;
}
}
out.println(interest);
%>
grazie per l'aiuto, volenteroso navigante! :cry: