September 2nd, 2002, 02:11 PM
I have a form containing 1 submit button, and 3 checkboxes (name: select,select,select,) and the form (name: check_form)
my submit is labled
<input type="submit" name="delete" value="Delete" onClick="funct()">
inside the function i have
//i wish to add a hidden in here based on which checkboxes were checked.
if(document.check_form.select[i].checked == true)
document.write('<input type="hidden" name="add_hidden[i]" value="yes">');
the problem is that it says that document.check_form.select[i] is null or not an object even though it is an object and works fine in another function. what am i doing wrong?
September 2nd, 2002, 07:51 PM
i fixed it myself
all is well
September 2nd, 2002, 07:55 PM
in case you want to know how i fixed it.
i went around the problem.
since im useing PHP with it, i named the checkbox "check[$t]"
document.this_form.check[$t].checked but that came up with an error
so i used instead
i used the +2 because what i wanted started with the 3rd object in the form and continued for an indefinite amount of time.
im just glad its over
September 2nd, 2002, 09:00 PM
will look for the i index of the object document.check_form.select. But, in your source, select is not an array, let alone defined. Also, in some browsers, document.check_form may not evaluate properly either, you should use document.forms.check_form.
In this case, the name select is being treated as a string, and the  operator isn't being interperted by the scripting engine.
September 2nd, 2002, 09:28 PM