|
-
May 9th, 2006, 09:19 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] remember check box selections...
PHP Code:
<form method="post">
<input type="checkbox" name="size[]" value="m">
<input type="checkbox" name="size[]" value="l">
<input type="checkbox" name="size[]" value="xl">
<input type="submit" name="go" value"Submit This"> <strong>Tomato Margherita - </strong> fresh tomato, olive oil, fresh basil, oregano and mozzarella<br>
<?if ($go and $HTTP_POST_VARS['size']){
//$size = $HTTP_POST_VARS['size'];
//echo $size[1];
foreach ($size as $f) {
echo $f."<br />";
}
} ?>
when this is submitted it displays the correct info, but does not maintain the checked boxes...
here is the site
http://www.questfor3d.com/phptest/FoodOrder.php
Last edited by damasterjo; May 10th, 2006 at 11:01 AM.
Software languages known:
Qbasic - TI-Basic - Liberty Basic - Visual Basic 6
Software API's known:
Directx 7 and 8
Internet languages, in the process of learning:
HTML - JAVASCRIPT - PHP - CSS - MYSQL - AJAX
-
May 10th, 2006, 11:42 AM
#2
Thread Starter
Fanatic Member
Re: remember check box selections...
Software languages known:
Qbasic - TI-Basic - Liberty Basic - Visual Basic 6
Software API's known:
Directx 7 and 8
Internet languages, in the process of learning:
HTML - JAVASCRIPT - PHP - CSS - MYSQL - AJAX
-
May 10th, 2006, 03:49 PM
#3
Thread Starter
Fanatic Member
Re: [RESOLVED] remember check box selections...
PHP Code:
<form method="POST">
<? if ($_POST['size1']) {?>
<input type="checkbox" name="size1" value="m" checked>
<?} else { ?>
<input type="checkbox" name="size1" value="m">
<?}?>
<? if ($_POST['size2']) {?>
<input type="checkbox" name="size2" value="l" checked>
<?} else { ?>
<input type="checkbox" name="size2" value="l">
<?}?>
<? if ($_POST['size3']) {?>
<input type="checkbox" name="size3" value="xl" checked>
<?} else { ?>
<input type="checkbox" name="size3" value="xl">
<?}?>
Software languages known:
Qbasic - TI-Basic - Liberty Basic - Visual Basic 6
Software API's known:
Directx 7 and 8
Internet languages, in the process of learning:
HTML - JAVASCRIPT - PHP - CSS - MYSQL - AJAX
-
May 13th, 2006, 05:48 AM
#4
Re: [RESOLVED] remember check box selections...
<input type="checkbox" name="size1" value="m"<?=$_POST['size1'] ? ' checked="checked"' : ''>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|