krs10_s Posted March 4, 2009 Share Posted March 4, 2009 I'm not sure about where to put all the "" in this combo: for($y=1;$y<=$_POST['expense'];$y++) { print "<tr><td style='border:0px solid black;'>".$y." <input type='text' name='$y'size='10'><b>R</b></input> <input type='text' name='$y'size='4'></input></td></tr>"; } print "</table>"; i need to insert this instead of the second text box but still close up the previous loop: print "<select name='numbers'>"; for($i=1;$i<100;$i++) { print "<option value='$i'>$i</option>"; } print"</select>"; PLEASE HELP!!! Link to comment https://forums.phpfreaks.com/topic/147936-dropdown-menu-loop-inside-a-for-loop/ Share on other sites More sharing options...
zartzar Posted March 4, 2009 Share Posted March 4, 2009 Hey. i take it you are trying to create X amount of tables, each with a dropdown menu. Right? part 2? Link to comment https://forums.phpfreaks.com/topic/147936-dropdown-menu-loop-inside-a-for-loop/#findComment-776425 Share on other sites More sharing options...
krs10_s Posted March 4, 2009 Author Share Posted March 4, 2009 it's cool i just got it right! its: for($m=1;$m<=$_POST['income'];$m++) { print "<tr><td style='border:0px solid black;'>".$m." <input type='text' name='$m'size='10'><b>R</b></input> <select name='rand'>"; for($k=1;$k<=100;$k++) { print "<option value='$k'>$k</option>"; } print "</select></td></tr>"; but now how do i get it to count up in 100's not 1's? Link to comment https://forums.phpfreaks.com/topic/147936-dropdown-menu-loop-inside-a-for-loop/#findComment-776436 Share on other sites More sharing options...
zartzar Posted March 4, 2009 Share Posted March 4, 2009 it's cool i just got it right! its: for($m=1;$m<=$_POST['income'];$m++) { print "<tr><td style='border:0px solid black;'>".$m." <input type='text' name='$m'size='10'><b>R</b></input> <select name='rand'>"; for($k=1;$k<=100;$k++) { print "<option value='$k'>$k</option>"; } print "</select></td></tr>"; but now how do i get it to count up in 100's not 1's? instead of $k++ make it $k=$k+100. Tada! Link to comment https://forums.phpfreaks.com/topic/147936-dropdown-menu-loop-inside-a-for-loop/#findComment-776441 Share on other sites More sharing options...
krs10_s Posted March 4, 2009 Author Share Posted March 4, 2009 thank! i'll try that again but then i didn't think it worked cuz it took really long to load as if it was counting to infinity or something but maybe i did something wrong, i'll try quick Link to comment https://forums.phpfreaks.com/topic/147936-dropdown-menu-loop-inside-a-for-loop/#findComment-776444 Share on other sites More sharing options...
zartzar Posted March 4, 2009 Share Posted March 4, 2009 thank! i'll try that again but then i didn't think it worked cuz it took really long to load as if it was counting to infinity or something but maybe i did something wrong, i'll try quick Weird ??? It should work i think. Now you are basically on the same page as i am. I cant figure out part 3, its killing me!!!! :'( Lemme know if you can do it pleaseeee! :'( Link to comment https://forums.phpfreaks.com/topic/147936-dropdown-menu-loop-inside-a-for-loop/#findComment-776448 Share on other sites More sharing options...
premiso Posted March 4, 2009 Share Posted March 4, 2009 but now how do i get it to count up in 100's not 1's? Explain what you mean by that. The loop should go to however many you tell it. Do you want it like 100, 200, 300 or just 1 through 100? Link to comment https://forums.phpfreaks.com/topic/147936-dropdown-menu-loop-inside-a-for-loop/#findComment-776472 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.