hey guys!
just working on a multiple checkbox solution which also restricts the number of boxes selected and im having dramas getting the php/mysql to work. It just doesnt seem to restrict you clicking the options or popup the warning window...any ideas for a complete newb??
ok the php/form part
Code:
<?
$siz=$i;
for($i=0;$i<$siz;$i++){
?>
<INPUT TYPE=CHECKBOX VALUE="<?
print $ch["id"][$i];
?> onClick="return KeepCount()"
" name="'sel1[1]' , , 'sel1[2]' , , 'sel1[3]' ">
<?
print $ch["title"][$i];
?><BR>
<?
}
?>
And now the section of javascript it should be calling:
Code:
function KeepCount() {
var NewCount = 0
if (document.NewUser.sel1[1].checked)
{NewCount = NewCount + 1}
if (document.NewUser.sel1[2].checked)
{NewCount = NewCount + 1}
if (document.NewUser.sel1[3]checked)
{NewCount = NewCount + 1}
if (NewCount == 4)
{
alert('Form Accepts 3 Selections Maximum')
document.NewUser; return false;
}
}
Any ideas why its not working??? do i have the onclick in the wrong place??