PDA

View Full Version : PHP: calling the value of a checkbox


Newmand2
12-20-2003, 12:51 PM
I am looking to create a form, whereby if a checkbox is checked, another bit of the form appears. It should go a bit like this, right?



<input type="checkbox" value="0">

<?php
if checkbox = 1 print '....rest of form....'
else print ''
end if
?>



I realise that I probably have to call the value with something like 'checkbox.value = 1'. How is this done... otherwise where am I going wrong?

Dynasty
12-20-2003, 03:51 PM
I think that for something like that you'd need to use javascript rather than php.

Aristotle
01-04-2004, 03:39 PM
Yeah, and this line:

<input type="checkbox" value="0">

Should be:

<input type="checkbox" value="0" />