Jump to content
Larry Ullman's Book Forums

Recommended Posts

I have figured out how to make a form sticky but couldn't make a list box sticky. Could anyone help


Code below



            <td bgcolor="#F1F9FB" class=normalboldtext><font size="2" face="Arial, Helvetica, sans-serif"> Title:<font color=red>*</font></font>
      <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>

Share this post

Link to post
Share on other sites

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 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>

            $currentYear = date("Y");
            for ($i = ($currentYear-15); $i >= ($currentYear-70); $i--)
                echo ("<option value='$i'>$i</option>");


Could anyone help with this one please?

Share this post

Link to post
Share on other sites

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.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...