FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » html php form second drop down select dependant list to keep selected value
Show: Today's Messages :: Unread Messages :: Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
html php form second drop down select dependant list to keep selected value [message #186184] Thu, 19 June 2014 12:20 Go to next message
pppbbb10 is currently offline  pppbbb10
Messages: 4
Registered: December 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Hi,

Is there a way to have the second drop down select list to keep the selected value after user hits submit?

<select class="select_Y" name="FLexA" id="LexikA">
<option value="0" >Please choose a context...</option>
<option value="1" <?php if (@$_POST['FLexA']==1) {echo "selected='selected'"; } ?> >Human nature , Health, Ethic, Religion...</option>
</select>

<select class="select_Y" name="FLexB" id="LexikB" jqsd:depends_on="LexikA" jqsd:hide_mode="disable">
<option value="0" rel="0" >Please choose...</option>
<option value="2" rel="1" <?php if (@$_POST['FLexB']==2) {echo "selected='selected'"; } ?> >Business, Law, Financezzz...</option>
<option value="3" rel="1" <?php if (@$_POST['FLexB']==3) {echo "selected='selected'"; } ?> >Sport, competition...</option>
</select>

Thansk,
Pascal
Message by Jerry Stuckle is ignored  [reveal message]  [reveal all messages by Jerry Stuckle]  [stop ignoring this user] Go to previous messageGo to next message
Re: html php form second drop down select dependant list to keep selected value [message #186186 is a reply to message #186185] Thu, 19 June 2014 13:22 Go to previous messageGo to next message
pppbbb10 is currently offline  pppbbb10
Messages: 4
Registered: December 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
I was just looking at this... using session_start and $_SESSION array...

Would it goes as:
document.getElementById("MyDropDown").value = '<?php echo $_SESSION['MyStoredValue']; ?>'

or

jQuery('#MyDropDown').val('<?php echo $_SESSION['MyStoredValue']; ?>');

thanks,
Pascal
Message by Jerry Stuckle is ignored  [reveal message]  [reveal all messages by Jerry Stuckle]  [stop ignoring this user] Go to previous messageGo to next message
Re: html php form second drop down select dependant list to keep selected value [message #186188 is a reply to message #186187] Thu, 19 June 2014 17:40 Go to previous message
pppbbb10 is currently offline  pppbbb10
Messages: 4
Registered: December 2013
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
Thanks Jerry for these useful advices, I should follow up on that implementing these
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: Authentication Framework?
Next Topic: for who use mailchimp: google considers the emails received as advertising?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Apr 21 07:48:47 EDT 2024

Total time taken to generate the page: 0.04834 seconds