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

 

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>

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

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.

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

Loading...
Sign in to follow this  

×
×
  • Create New...