radio button checked by default

They have: 1 posts

Joined: Sep 2009

Hi

I have a section where when joining the customer must select if they are male or female.

as its a male orientated site, i want the male default button to be selected as default, but i dont know how to do this...

can anyone tell me what i need to do with this code

<td class="infoBoxContents"><?php echo tep_draw_radio_field('gender', 'm') . '&nbsp;&nbsp;' . MALE . '&nbsp;&nbsp;' . tep_draw_radio_field('gender', 'f') . '&nbsp;&nbsp;' . FEMALE . '&nbsp;' . (tep_not_null(ENTRY_GENDER_TEXT) ? '<span class="inputRequirement">' . ENTRY_GENDER_TEXT . '</span>': ''); ?></td>

to make the MALE radio button checked by default

thanks heaps !

They have: 121 posts

Joined: Dec 2008

Oh my, OsCommerce.

Looking at the function definition in includes/functions/html_output.php I see
function tep_draw_radio_field($name, $value, $checked = false, $parameters = '')

So... you'd want to
tep_draw_radio_field('gender', 'm', true); // Where true = 'checked' for the option you've just added.

Cheers,
Shaggy.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.