I am trying to get a check box to automatically get check if some one enter info into a field.
this is html code that work for HTML but not if I need an array in php
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
FormName = "form" //Name of the form
CheckName = "check" //Name of the checkboxes (without 1,2,3)
TextName = "text" //Name of the textfields (without 1,2,3)
var Condition=new Array(
'a!=""', //Must be filled
'a!=""', //Must be filled
'a!=""', //Must be filled
'a!=""' //Must be filled
);
function docheck(w) {
eval("a=document." + FormName + "." + TextName + w + ".value");
if (eval(Condition[w])) eval("document." + FormName + "." + CheckName + w + ".checked=true");
else eval("document." + FormName + "." + CheckName + w + ".checked=false");
}
// End -->
</script>
</HEAD>
<BODY>
<form name=form>
<input type=checkbox name=check0 onClick="return false"> name: <input type=text name=text0 onBlur='docheck("0")'><BR>
<input type=checkbox name=check1 onClick="return false"> name: <input type=text name=text1 onBlur='docheck("1")'><BR>
<input type=checkbox name=check2 onClick="return false"> name: <input type=text name=text2 onBlur='docheck("2")'><BR>
<input type=checkbox name=check3 onClick="return false"> name: <input type=text name=text3 onBlur='docheck("3")'><BR>
</form>
</body>
I need the name of the check boxes to be check[] (not check1, check2, etc) and text to be text[]
Any ideas?
Thanks