Public Voice Network
- ATTN: Greedy Republicans 1515
- Chick of the Day 1537915379
- Letterpress process video 22
- New York 44
- Pic of the Day 6329963299
- Show your latest Pics 32943294
- XBMC 33
- what happened? 2222
- F1 2012 1919
- Vid of the Day 1203312033
- the gif animation thread 1282812828
- paper trail 88
- Facebook IPO 156156
- Diablo III 8383
- Coda 2 3434
- Euro Crisis 66
- In Dallas for a month 1212
- shopped? 66
- Oh Amazon. 22
- blog 5626456264
- pdf portfolio 99
- I can see it in the pixel… 1919
- TransFatty @Brooklyn Bowl 1717
- wot dis font? 11
Form validation? 1212 Responses
Last post: 2 years, 3 months ago | Thread started: Feb 8, 10, 1:15 p.m.
- fugged
submit handler function should return false to prevent the form from submitting.
so in your handler function you need to test and see if the checkbox is checked. if so, return true - (and the for will submit) otherwise return false (and the form will be prevented from submitting)


- Dog-earFeb 8, 10, 1:27 p.m. – Permalink
- fugged
I gotcha boobs. check it again.:
http://gist.github.com/298594

- Dog-earFeb 8, 10, 1:42 p.m. – Permalink
- ayport
Can always do it server side:
HTML:
<form action="formProcessor.php" method="post">
<input type="checkbox" value="yes" name="checkbox">
<input type="submit">
</form>PHP (asp or asp.net works the same):
<?
if ($_POST['checkbox'] == "yes")
{
// process rest of form
}
else
{
echo "please check the box";
}
?>

- Dog-earFeb 8, 10, 2:15 p.m. – Permalink



