Jump to content

Dropdown menu question!


krs10_s

Recommended Posts

When creating a dropdown is it normal to write out all the dropdown options or can you use a loop or something? let me know if question is not clear:)

 

Hey fellow noob! Yes it much easier to use a for loop especially when you are dealing with a large amount of numbers. Heres an example, print numbers 1 to 100

 

print "<select name='numincome'>";

 

for($c=1; $c<=100; $c++)

{

print "<option value='$c'>$c</option>";

}

 

print "</select>";

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.