I 'm developing a form with ajax and JSP, but I'm stuck at this checkbox values. I want to send the selected checkbox values to another page.
What I'm trying to do is to get checkbox values from "app.jsp" to "senDbase.jsp".
Here I'm not using FORM.
app.jsp
<input type="checkbox" name="chb" id="chb1" value="html" />HTML<br/>
<input type="checkbox" name="chb" id="chb2" value="css" />CSS<br/>
<input type="checkbox" name="chb" id="chb3" value="javascript" />JavaScript<br/>
<input type="checkbox" name="chb" id="chb4" value="php" />php<br/>
<input type="checkbox" name="chb" id="chb5" value="python" />Python<br/>
<input type="checkbox" name="chb" id="chb6" value="net" />Net<br/>
<input type="button" value="Click" id="btntest" />
Here is what I've tried
try
{
var url="senDbase.jsp";
url += "&chkbx1=" +document.getElementById("chb1").value;
url += "&chkbx2=" +document.getElementById("chb2").value;
url += "&chkbx3=" +document.getElementById("chb3").value;
url += "&chkbx4=" +document.getElementById("chb4").value;
url += "&chkbx5=" +document.getElementById("chb5").value;
url += "&chkbx6=" +document.getElementById("chb6").value;
}
catch(e)
{
alert('error sending variables');
}
I'm not getting these values on the "senDbase.jsp".