[SOLVED]radio button code
Posted: Thu Mar 16, 2006 5:04 pm
From what I have seen, the code to preselect radio buttons is something like this:
But two things don't seem to work. When the page first loads the wrong radio button is check and when you click on it or any of the other buttons the correct button becomes checked.
Secondly once they are checked you can't change selection to another radio button.
Can someone tell me where I am going wrong?
Thanks
rj
Code: Select all
<input type="radio" name="status" value="active" <?php if($get_status['status'] = "active"){echo 'checked = "checked"';} ?> />
Active
<input type="radio" name="status" value="inactive" <?php if($get_status['status'] = "inactive"){echo 'checked = "checked"';} ?> />
Inactive
<input type="radio" name="status" value="complete" <?php if($get_status['status'] = "complete"){echo 'checked = "checked"';} ?> />
Complete
<input name="Update" type="submit" id="Update" value="Update" />Secondly once they are checked you can't change selection to another radio button.
Can someone tell me where I am going wrong?
Thanks
rj