dynamic options
Posted: Fri Jan 28, 2011 4:00 am
I've a series of options (chosen with a radio button) which draw data from my database, I want to make the first option automatically chosen.
Right now I can only get it to auto-choose the last option.
The problem I'm having is there is no set value as it chooses it from the DB and theres a number of options that this could be so I don't know how to go about forcing it to the first one.
The above code is what generates the radio buttons, any ideas how to make this choose the first option?
Cheers,
Aravona
Right now I can only get it to auto-choose the last option.
The problem I'm having is there is no set value as it chooses it from the DB and theres a number of options that this could be so I don't know how to go about forcing it to the first one.
Code: Select all
<?php while (wpsc_have_variation_groups()) : wpsc_the_variation_group(); ?>
<input type="radio" value="<?php echo wpsc_the_variation_id(); ?>" class='wpsc_select_variation' name="variation[<?php echo wpsc_vargrp_id(); ?>]" id="<?php echo wpsc_vargrp_form_id(); ?>" checked="checked">
<?php endwhile; ?>Cheers,
Aravona