briansgl Posted April 24, 2014 Share Posted April 24, 2014 I have figured out how to make a form sticky but couldn't make a list box sticky. Could anyone help Code below Thanks <tr> <td bgcolor="#F1F9FB" class=normalboldtext><font size="2" face="Arial, Helvetica, sans-serif"> Title:<font color=red>*</font></font> </td> <td> <font size="2" face="Arial, Helvetica, sans-serif"> <select name=title> <option value=""> </option> <option value="Mr.">Mr. </option> <option value="Mrs.">Mrs. </option> <option value="Miss.">Miss. </option> <option value="Ms.">Ms. </option> </select> </font></td> </tr> Link to comment Share on other sites More sharing options...
HartleySan Posted April 24, 2014 Share Posted April 24, 2014 Add selected="selected" to the appropriate option. Link to comment Share on other sites More sharing options...
briansgl Posted April 25, 2014 Author Share Posted April 25, 2014 Thanks Jon. I have managed to make the normal fields sticky: <span style="color:#000000;font-family:Arial;font-size:12px;">First Name:</span></div> <input type="text" id="fname" name="fname" value="<?php if(isset($_POST['fname'])) echo $_POST['fname'];?>"> The Multi Select Box is sorted by: <option>Month</option> <option value="selected="selected"January">January</option> <option value="selected="selected"February">February</option> I also have a Year field and not sure how to do that. The code picks up the year using a php function <select name=byear> <option value=""> Year </option> <?php $currentYear = date("Y"); for ($i = ($currentYear-15); $i >= ($currentYear-70); $i--) { echo ("<option value='$i'>$i</option>"); } ?> </select> Could anyone help with this one please? Link to comment Share on other sites More sharing options...
Larry Posted April 25, 2014 Share Posted April 25, 2014 I'm pretty sure there's an example of a sticky select menu in the book. But if you look at your month HTML, you're adding the selected="selected" within the value, instead of after the value. Link to comment Share on other sites More sharing options...
Recommended Posts