Deimos
10-20-2003, 01:36 PM
This is partially a JSP question but i think the problem has to do with the javascript filling in the data to the form.
The page works perfectly for the checkbox 0-9. as in the inputs are called somedata_1, somedata_2 etc..
When it gets to somedata_10 or somedata_11, on the following page like target.jsp, no data shows up. the somedata_10 is empty. I have no idea why this is happening.
Any help is greatly appreciated.
<javascript>
function somefunction()
{
var numboxes = document.testForm.length;
for(i=0;i<numboxes;i++)
{
if(document.testForm["somebox_"+i].checked)
{
document.sendForm["somedata_"+i].value =
document.testForm["somedata_"+i].value;
}
}
}
</javascript>
<form name="testForm" method="post"
action="javascript:somefunction()">
// using jsp loop over something
for(i=0; i<someLen; i++)
{
<input type="checkbox" name="somebox_<%= i %>">
<input type="hidden" name="somedata_<%= i %>"
value="somedata">
}
</form>
<form name="sendForm" method="post"
action="target.jsp">
// using jsp loop over something
for(i=0; i<someLen; i++)
{
<input type="hidden" name="somedata_<%= i %>">
}
</form>
The page works perfectly for the checkbox 0-9. as in the inputs are called somedata_1, somedata_2 etc..
When it gets to somedata_10 or somedata_11, on the following page like target.jsp, no data shows up. the somedata_10 is empty. I have no idea why this is happening.
Any help is greatly appreciated.
<javascript>
function somefunction()
{
var numboxes = document.testForm.length;
for(i=0;i<numboxes;i++)
{
if(document.testForm["somebox_"+i].checked)
{
document.sendForm["somedata_"+i].value =
document.testForm["somedata_"+i].value;
}
}
}
</javascript>
<form name="testForm" method="post"
action="javascript:somefunction()">
// using jsp loop over something
for(i=0; i<someLen; i++)
{
<input type="checkbox" name="somebox_<%= i %>">
<input type="hidden" name="somedata_<%= i %>"
value="somedata">
}
</form>
<form name="sendForm" method="post"
action="target.jsp">
// using jsp loop over something
for(i=0; i<someLen; i++)
{
<input type="hidden" name="somedata_<%= i %>">
}
</form>