sophielois
Technical User
Hi, ill try and explain the best i can.
i have 2 variables that are passed to a page which holds a form.
These are the two variables
and this is the form
I need to apply "checked" to the checkboxes that have the same value as $unit1 and $unit2
but I really dont know how i would do this
Sophx
i have 2 variables that are passed to a page which holds a form.
These are the two variables
Code:
$unit1 = H21
$unit2 = H22
and this is the form
Code:
<form action="add.php" method="post" onsubmit="return doSubmit();">
<input type="checkbox" name="cb[]" value="H21" onclick="keepTrack(this);" /> H21<br />
<input type="checkbox" name="cb[]" value="H22" onclick="keepTrack(this);" /> H22<br />
<input type="checkbox" name="cb[]" value="H23" onclick="keepTrack(this);" /> H23<br />
<input type="checkbox" name="cb[]" value="H24" onclick="keepTrack(this);" /> H24<br />
<input type="checkbox" name="cb[]" value="H25" onclick="keepTrack(this);" /> H25<br />
<input type="checkbox" name="cb[]" value="H26" onclick="keepTrack(this);" /> H26<br />
<input type="checkbox" name="cb[]" value="H27" onclick="keepTrack(this);" /> H27<br />
<input type="checkbox" name="cb[]" value="H28" onclick="keepTrack(this);" /> H28<br />
<input type="submit" name="add" value="Proceed">
</form>
I need to apply "checked" to the checkboxes that have the same value as $unit1 and $unit2
but I really dont know how i would do this
Sophx