i new php. found following code snippet in tutorial while trying learn radio button. echo statement never gets executed( not see checked statement printed ever). purpose of echo statement?
<input type="radio" name="gender" <?php if (isset($gender) && $gender=="female") echo "checked";?> value="female">female <input type="radio" name="gender" <?php if (isset($gender) && $gender=="male") echo "checked";?>value="male">male
in scenario if condition compare value of $gender. when value matches echo print "checked" attribute inside radio in html. radio button appear checked.
you can see view source.
Comments
Post a Comment