Jump to content

building a dropdown


phppup

Recommended Posts

If I use this code:

$values = range(0, 10);

echo "<select name=\"my_field\">\n";

foreach($values as $v) {

echo "<option value=\"$v\">$v</option>\n";

}echo "</select>\n";

 

to generate a dropdown, it will offer options from 1 thru 10. 

 

Is there any way to make them increment by .50 (ie: 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, etc.?

Link to comment
https://forums.phpfreaks.com/topic/257631-building-a-dropdown/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.