jaiffed Posted February 17, 2010 Share Posted February 17, 2010 i have two combo box book Id and Member Id i need script that when user select both combo box and not select any and press submit then error generated and when user select any one of them and press submit button then it pass value to another form bookretadd.php my script is attached you can check what i want [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/192427-pass-value-of-combo-box/ Share on other sites More sharing options...
thunder708 Posted February 17, 2010 Share Posted February 17, 2010 all i can think of right now is that if you change your select names to two different names, so dont call them both itemissue, so for example if you called the firstone labelid and the second one memberid, on your bookreturnadd page you could have the code: $labelid = $_REQUEST['labelid']; $memberid = $_REQUEST['memberid']; as you havnt assigned a value to the first option you could have after: if (empty($labelid) || empty($$memberid) { echo "You Have failed to pick an option please go back"; echo "<a href='javascript: history.go(-1)'>Go Back</a>"; } im not sure how you want to use it in your book return add page but say for ecample you wanted to see the value in a text box you could have: echo "<input type='text' name='lableid' value='".$labelid."'><br> <input type='text' name='memberid' value='".$memberid."'>"; I Hope this helps! Edit: forgot to mention dont forget to include the code between the <? ?> tags Link to comment https://forums.phpfreaks.com/topic/192427-pass-value-of-combo-box/#findComment-1014029 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.