Home »
Imported messages »
comp.lang.php »
html php form second drop down select dependant list to keep selected value
html php form second drop down select dependant list to keep selected value [message #186184] |
Thu, 19 June 2014 16:20  |
pppbbb10
Messages: 4 Registered: December 2013
Karma: 0
|
Junior Member |
|
|
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
|
|
|
Re: html php form second drop down select dependant list to keep selected value [message #186185 is a reply to message #186184] |
Thu, 19 June 2014 17:08   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On 6/19/2014 12:20 PM, ba pa wrote:
> 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
>
The best way to save values across pages is in the $_SESSION superglobal.
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex(at)attglobal(dot)net
==================
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Mar 08 20:28:04 GMT 2025
Total time taken to generate the page: 0.03827 seconds