QWERTYtech Posted May 3, 2007 Share Posted May 3, 2007 Okay, I have a page I'm working on in PHP and I need a simpler way to autopopulate a dropdown menu. I have dropdown list that i need the numbers 00 to 59 populated without having to hand code it. Can I do this? Quote Link to comment Share on other sites More sharing options...
Barand Posted May 3, 2007 Share Posted May 3, 2007 <?php echo '<select name="dropdown">'; for ($i=0; $i<60; $i++) { printf ('<option value="%02d">%02d</option>', $i, $i); } echo '</select>'; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.