aegirbrands
asked on
Creating sticky select form field using $_GET[] details.
Probably quite simple but I cant seem to get this working.
I just want the select field to pre-select the $_GET[s_display] value when this is present.
Any help is much appriciated.
************************** ********** ********** ********** *********
<select name="s_display">';
<?php
$display_number = array (2,5,10,20,30,50,100);
foreach ($display_number as $key => $value) {
echo "<option value=\"$key\"";
if (isset($_GET['s_display']) ) {
echo "selected=\"selected\"";
}
echo ">$value</option>\n";
}?>
</select>
I just want the select field to pre-select the $_GET[s_display] value when this is present.
Any help is much appriciated.
**************************
<select name="s_display">';
<?php
$display_number = array (2,5,10,20,30,50,100);
foreach ($display_number as $key => $value) {
echo "<option value=\"$key\"";
if (isset($_GET['s_display'])
echo "selected=\"selected\"";
}
echo ">$value</option>\n";
}?>
</select>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER