keyboarder Posted September 21, 2010 Share Posted September 21, 2010 GREAT this forum - JUST GREAT !... Issue: All data entered into my online form was lost (blanked out) and the form returned correctly with message "wrong verification code", when submitted with the wrong verification code. However, going through this great forum I managed to get all - manually entered - data back ! I placed value="<?php echo $_GET['the_field_name'];?>"/ after each input field. BUT... not so with input fields entered from drop-down menu ! How do I put a similar string for the field "Payment by" in this sample: <tr> <td class="table-inquire" width="47%"> <font face="Verdana" size="1" color="#000042"> Payment by:</font></td> <td class="table-inquire" width="51%" colspan="2"> <font color="#400000" face="Verdana"> <select name="payment" size="1"> <option value="VISA">VISA</option> <option value="MASTER">MASTER</option> <option value="CASH">CASH</option> <option value="T/T Banktransfer">T/T Banktransfer</option> <option selected>Please select</option> </select></font><font size="2" color="#400000" face="Verdana"></font></td> </tr> Any advise greatly appreciated. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/213990-refill-form-values-received-from-drop-down-menu/ Share on other sites More sharing options...
keyboarder Posted September 21, 2010 Author Share Posted September 21, 2010 OOOPS... It's me again: Same counts for the message field. It's gone also.... Can anyone advise please, what I have to specify, in order to keep the message field preserved in this sample: <font face="Verdana" size="2" color="#000042"><br> Further comments:<br></font <font color="#400000" face="Verdana"> <textarea rows="5" name="message" cols="60"></textarea> Thanks again Quote Link to comment https://forums.phpfreaks.com/topic/213990-refill-form-values-received-from-drop-down-menu/#findComment-1113647 Share on other sites More sharing options...
ram4nd Posted September 21, 2010 Share Posted September 21, 2010 Maybe you use POST not GET to send form data??? Quote Link to comment https://forums.phpfreaks.com/topic/213990-refill-form-values-received-from-drop-down-menu/#findComment-1113798 Share on other sites More sharing options...
billckr Posted September 22, 2010 Share Posted September 22, 2010 You use the same method as before; <select name="payment"> <option value="<?php echo $_POST['payment'];?>" selected><?php echo $_POST['payment'];?></option> Change _POST to _GET if using URL and Not a form. The above keeps the value from the post data and makes it the selected option so it shows just like it did on the prior form. Not 100% thats what your asking but if so, there you go. Bill. Quote Link to comment https://forums.phpfreaks.com/topic/213990-refill-form-values-received-from-drop-down-menu/#findComment-1113930 Share on other sites More sharing options...
vijdev Posted September 22, 2010 Share Posted September 22, 2010 use an if statement if true, assign checked="checked" for that particular option value Quote Link to comment https://forums.phpfreaks.com/topic/213990-refill-form-values-received-from-drop-down-menu/#findComment-1113940 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.