Reputation: 9
CODE am trying:
<input type="radio" name="type" value="Male" <?php if ($type == 'Male') echo 'checked="checked"'; ?>"> Male
OR
<input type="radio" name="gender" value="<?php echo $gender ?>"/>Female
This one is right ??
i refer 2 links in SO but m not getting properly with radio button .... Suggestions always Welcome ...
Upvotes: 0
Views: 10208
Reputation: 16989
The first one is correct:
<input type="radio" name="type" value="Male" <?php if ($type == 'Male') echo 'checked="checked"'; ?>"> Male
Upvotes: 1