Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function someplugin_select() {
- $options = get_option( 'plugin_252calc');
- echo $options; //shows the correct value selected
- $items = array();
- for ($i=6; $i <=10; $i+= 0.1)
- {
- $items[] = $i;
- }
- echo '<select id="cf-nb" name="cf-nb">';
- foreach ( $items as $item )
- {
- echo '<option value="'. $item .'"';
- if ( $item == $options ) echo' selected="selected"';
- echo '>'. $item .'</option>';
- }
- echo '</select>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement