web2000 Posted May 17, 2006 Share Posted May 17, 2006 Hello,I have a listbox that is part of a submit form.I want this listbox to display values that are multiplied from another field in the URL.So...Basically when the page loads a parameter called 'nocase' has a value in the url, something like 6, 12, etcSay for instance the nocase parameter in the URL is '4' i want the list box to put 4, 8, 12, 16, 20, 24, And if the nocase URL parameter is 12, i want the listbox to display 12, 24, 36, 48, 60, 72, etcPlease help...and stuckRegards Link to comment https://forums.phpfreaks.com/topic/9853-list-box-mutiplying-on-another-value/ Share on other sites More sharing options...
samshel Posted May 17, 2006 Share Posted May 17, 2006 [code] <select name="list"><?php $nocase = $_GET['nocase'];for($i=2;$i<10;$i++) { echo "<option value='".($nocase*$i)."'>".($nocase*$i)."</option>";}?></select>[/code]the code is not tested, but shud workhth Link to comment https://forums.phpfreaks.com/topic/9853-list-box-mutiplying-on-another-value/#findComment-36586 Share on other sites More sharing options...
web2000 Posted May 17, 2006 Author Share Posted May 17, 2006 You are a geniusThank you very much Link to comment https://forums.phpfreaks.com/topic/9853-list-box-mutiplying-on-another-value/#findComment-36589 Share on other sites More sharing options...
web2000 Posted May 17, 2006 Author Share Posted May 17, 2006 Hi,Do you know how i can also get the nocase in the list as well?Like at the moment if its 2, it will put 4, 6, 8, 10, 12 etcAnyway to get it 2, 4, 6 etcRegards Link to comment https://forums.phpfreaks.com/topic/9853-list-box-mutiplying-on-another-value/#findComment-36599 Share on other sites More sharing options...
.josh Posted May 17, 2006 Share Posted May 17, 2006 change $i=2 to $i=1 in your for loop Link to comment https://forums.phpfreaks.com/topic/9853-list-box-mutiplying-on-another-value/#findComment-36613 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.