Click to See Complete Forum and Search --> : form radio button data retention


glenn.php
03-24-2008, 07:22 AM
i have a form that returns the user upon a number of errors (of course) - i'm able to retain the text input data (value="<?php echo $_POST['em_name'] ?>") upon return, but i don't know how to retain the radio button or checkbox data so that they don't have to recheck it if necessary. it's in html/php...

can someone help?

much appreciated...

GN

Altriak
03-24-2008, 11:13 AM
Something like this should work:

<input type="radio" name="thename" value="thevalue" <?php if (isset($_POST['thename']) && ($_POST['thename'] == 'thevalue')) echo ' checked="checked"'; ?>
...
...

glenn.php
03-24-2008, 11:18 AM
beautiful - worked great with radio and checkbox...

thanks
GN