forms
Posted: Sat Aug 10, 2002 5:02 pm
What are the key words/variables for radio and check boxes?
if checkbox== checked?
Thats for anyhelp
if checkbox== checked?
Thats for anyhelp
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<html><body>
<form method="POST">
<fieldset><legend>single checkboxes</legend>
<input type="checkbox" name="single" />a single checkbox<br/>
<input type="checkbox" name="cbwithvalue" value="myValue"/>a single checkbox with value<br/>
</fieldset>
<fieldset><legend>checkboxe-array without value</legend>
<input type="checkbox" name="cbarrayї]"/>checkbox 'array' #1<br/>
<input type="checkbox" name="cbarrayї]"/>checkbox 'array' #2<br/>
<input type="checkbox" name="cbarrayї]"/>checkbox 'array' #3<br/>
</fieldset>
<fieldset><legend>checkboxe-array with value-properties</legend>
<input type="checkbox" name="cbarrayVї]" value="A"/>checkbox 'array' with value #1<br/>
<input type="checkbox" name="cbarrayVї]" value="B"/>checkbox 'array' with value #2<br/>
<input type="checkbox" name="cbarrayVї]" value="C"/>checkbox 'array' with value #3<br/>
</fieldset>
<input type="submit"/>
</form>
<pre>
<?php
print_r($_POST);
?>
</pre>
</body>
</html>Code: Select all
if ($_POSTї'siteOFF'])
{
// your checkbox is set!
}