Welcome Guest, Not a member yet? Register   Sign In
Form validation with radio buttons when updating form
#1

[eluser]sdotsen[/eluser]
I have a form that pulls data from a database.
Code works fine if it's an input box but I can't get the latest $_POST data for radio buttons.

This works for input text box. I get default values pulled from the DB on first load, and I can get the new input (if any) from the user modifies the input box on a failed validation.

Code:
<?php echo form_input('email',set_value('email', $email)); ?>

Here's the code for one of my radio button. It works when I'm pulling data from the DB, but if the form refreshes due to a failed validation, I'm not sure how I can show what the user selected.

Code:
<input type="radio" name="gender" value="male" <?php if($gender == "male") echo "checked";  ?> />Male

I played around with set_radio but i ran into the same issue.


Messages In This Thread
Form validation with radio buttons when updating form - by El Forum - 01-09-2010, 11:08 AM
Form validation with radio buttons when updating form - by El Forum - 01-09-2010, 12:59 PM
Form validation with radio buttons when updating form - by El Forum - 11-03-2010, 05:06 PM
Form validation with radio buttons when updating form - by El Forum - 11-04-2010, 06:29 AM
Form validation with radio buttons when updating form - by El Forum - 11-04-2010, 01:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB