wolfcry Posted January 8, 2012 Share Posted January 8, 2012 Hey all, Another question for you. How does one make it so that the selections (choices) a user selects for dynamic selection boxes remain after the form is posted, which does post back to itself? I've tried JavaScript using the "name" of the selection box as the id but I must be doing something wrong because it's not working..as usual lol. The values in the selection boxes are populated dynamically so I'm not sure how to do this. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/254594-ensuring-dynamic-selections-remain-after-submitting/ Share on other sites More sharing options...
litebearer Posted January 8, 2012 Share Posted January 8, 2012 perhaps seeing some of your code would be helpful Quote Link to comment https://forums.phpfreaks.com/topic/254594-ensuring-dynamic-selections-remain-after-submitting/#findComment-1305511 Share on other sites More sharing options...
wolfcry Posted January 8, 2012 Author Share Posted January 8, 2012 <?php echo '<select name="myselectionbox">'; for($i = 1; $i <= 5; $i++){ echo '<option value="'.$i.'">'.$i.'</option>'; } echo '</selection>'; ?> I suppose so, but it's just your average dynamic selection box. Also, just an FYI, the form is posting back to same page using POST method. Quote Link to comment https://forums.phpfreaks.com/topic/254594-ensuring-dynamic-selections-remain-after-submitting/#findComment-1305512 Share on other sites More sharing options...
litebearer Posted January 8, 2012 Share Posted January 8, 2012 This thread should get you going in the right direction http://www.phpfreaks.com/forums/index.php?topic=214678.0 Quote Link to comment https://forums.phpfreaks.com/topic/254594-ensuring-dynamic-selections-remain-after-submitting/#findComment-1305513 Share on other sites More sharing options...
wolfcry Posted January 8, 2012 Author Share Posted January 8, 2012 Ah nice, thank you litebearer! Quote Link to comment https://forums.phpfreaks.com/topic/254594-ensuring-dynamic-selections-remain-after-submitting/#findComment-1305514 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.