Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Selected Options on Dropdowns Not Working

  1. #1
    Join Date
    Jul 2011
    Posts
    16

    Question Selected Options on Dropdowns Not Working

    I have dropdown menus on a multi-page form with pre-selected options that aren't processed by FormMail after the first page of the form. On the initial HTML page of the form, one of my dropdowns shows the pre-selected option just fine but after that, other dropdowns don't even process the "selected" attribute of the <option> tag it doesn't even show up in the page source. Something seems really wrong there but I've gone over the code and the reality is it's actually just copied and pasted from a prior working HTML form of mine that shows all the pre-selected options correctly. It would appear FormMail is deleting the selected="selected" attribute from the options. Is there a cause for this?

  2. #2
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Selected Options on Dropdowns Not Working

    returning from error or just moving forward in the form pages?

    a URL would help so we can see wot u mean

  3. #3
    Join Date
    Jul 2011
    Posts
    16

    Default Re: Selected Options on Dropdowns Not Working

    I sent you the link with login info.

    Basically, I have three menus for selecting a specific time; a dropdown for actual time of day (in half hour increments), AM/PM, and the six timezones covering the US. In the HTML I have 12:00 PM PST pre-selected from the options. The code looks like this:

    Code:
    <select id="signTime" name="signTime">
    <option selected="selected" value="12:00">12:00</option>
    <option value="12:30">12:30</option>
    <option value="1:00">1:00</option>
    <option value="1:30">1:30</option>
    <option value="2:00">2:00</option>
    <option value="2:30">2:30</option>
    <option value="3:00">3:00</option>
    <option value="3:30">3:30</option>
    <option value="4:00">4:00</option>
    <option value="4:30">4:30</option>
    <option value="5:00">5:00</option>
    <option value="5:30">5:30</option>
    <option value="6:00">6:00</option>
    <option value="6:30">6:30</option>
    <option value="7:00">7:00</option>
    <option value="7:30">7:30</option>
    <option value="8:00">8:00</option>
    <option value="8:30">8:30</option>
    <option value="9:00">9:00</option>
    <option value="9:30">9:30</option>
    <option value="10:00">10:00</option>
    <option value="10:30">10:30</option>
    <option value="11:00">11:00</option>
    <option value="11:30">11:30</option>
    </select>
    <select id="signAMPM" name="signAMPM">
    <option value="AM">AM</option>
    <option selected="selected" value="PM">PM</option>
    </select>
    <select id="timeZone" name="timeZone">
    <option value="HAST">HAST</option>
    <option value="AKST">AKST</option>
    <option selected="selected" value="PST">PST</option>
    <option value="MST">MST</option>
    <option value="CST">CST</option>
    <option value="EST">EST</option>
    </select>
    But, as I said, when I'm actually going through the form (these dropdowns occur on page three), the attributes selected="selected", are missing. The actual page source looks like this:

    Code:
    <label for="signTime">Signing Time:</label>
    <select id="signTime" name="signTime">
    <option  value="12:00">12:00</option>
    <option value="12:30">12:30</option>
    <option value="1:00">1:00</option>
    <option value="1:30">1:30</option>
    <option value="2:00">2:00</option>
    <option value="2:30">2:30</option>
    <option value="3:00">3:00</option>
    <option value="3:30">3:30</option>
    <option value="4:00">4:00</option>
    <option value="4:30">4:30</option>
    <option value="5:00">5:00</option>
    <option value="5:30">5:30</option>
    <option value="6:00">6:00</option>
    <option value="6:30">6:30</option>
    <option value="7:00">7:00</option>
    <option value="7:30">7:30</option>
    <option value="8:00">8:00</option>
    <option value="8:30">8:30</option>
    <option value="9:00">9:00</option>
    <option value="9:30">9:30</option>
    <option value="10:00">10:00</option>
    <option value="10:30">10:30</option>
    <option value="11:00">11:00</option>
    <option value="11:30">11:30</option>
    </select>
    <select id="signAMPM" name="signAMPM">
    <option value="AM">AM</option>
    <option  value="PM">PM</option>
    </select>
    <select id="timeZone" name="timeZone">
    <option value="HAST">HAST</option>
    <option value="AKST">AKST</option>
    <option  value="PST">PST</option>
    <option value="MST">MST</option>
    <option value="CST">CST</option>
    <option value="EST">EST</option>
    </select>
    Somehow that attribute is being stripped and, as you will see, the menus are defaulting to 12:00 AM HAST. It has to be getting done by FormMail. I have tried switching the DOCTYPE to both XHTML 1.0 and HTML 4.01 with no joy, as well as switching to HTML5-spec-friendly unquoted attributes. Also, this problem does not occur on the first — HTML — page of the form where there is also a dropdown with a pre-selected option. Also, this issue occurs in multiple browsers.
    Last edited by centerNegative; 02-Aug-2011 at 03:18 AM. Reason: Additional details

  4. #4
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Selected Options on Dropdowns Not Working

    on page 2 the "selected" stays there for state

    yes, its missing on page3 for time, but that could be caused by anything, and not likely formmail

    are ur templates static HTML or PHP or SSI?

    are u using MULTIFORMURL or MULTIFORMDIR?

    try creating a simple 2 page test with hardly any fields that shows the problem

    if ur convinced its a problem then do a bug report (i think i've seen 3 bugs in 8 years in formmail, so thats why i say its not likely to be formmail, but u never know)

  5. #5
    Join Date
    Jul 2011
    Posts
    16

    Default Re: Selected Options on Dropdowns Not Working

    Everything is static HTML and I'm using MULTIFORMURL. I'll try MULTIFORMDIR and see what happens.

    Update: No change there.

    I'll try using the default sample multi-form from Tectite with a pre-selected dropdown and see what happens there.
    Last edited by centerNegative; 02-Aug-2011 at 04:36 AM.

  6. #6
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Selected Options on Dropdowns Not Working

    another way to troubleshoot is to open a URL directly to the template file using ur browser

    if the HTML is missing, then it can't be formmail thats doing it

  7. #7
    Join Date
    Jul 2011
    Posts
    16

    Default Re: Selected Options on Dropdowns Not Working

    OK, here's the results of testing. If I open the third page HTML file directly and check the page source, the selected attribute is not missing.

    Also, I added the following code to the stock Tectite multi-form sample pages 2 and 3:

    Code:
    <tr>
    <td>This is a drop-down:&nbsp;<select name="dropdown">
    <option value="option1">Option 1</option>
    <option value="option2">Option 2</option>
    <option selected="selected" value="option3">Option 3</option>
    </select>
    </td>
    </tr>
    On page 2, "Option 3" is pre-selected in the dropdown as hoped for. On page 3 it is not "Option 1" is selected. In the page source the selected attribute has once again been stripped, leaving the tell-tale space.

    Code:
    <tr>
    <td>This is a drop-down:&nbsp;<select name="dropdown">
    <option value="option1">Option 1</option>
    <option value="option2">Option 2</option>
    <option  value="option3">Option 3</option>
    </select>
    </td>
    </tr>
    Another odd feature is that when I go to page 2 and check the source, the selected attribute has been moved to after the value attribute (it's before in the code), and there's an extra space again.

    Code:
    <td>This is a drop-down:&nbsp;<select name="dropdown">
    <option value="option1">Option 1</option>
    <option value="option2">Option 2</option>
    <option  value="option3" selected="selected">Option 3</option>
    </select>
    </td>
    There is definitely some strange behaviour here and I have to believe it's on the part of FormMail. Are you able to re-produce these results yourself?

  8. #8
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Selected Options on Dropdowns Not Working

    can u shoot me the url for ur new simple test pages?

  9. #9
    Join Date
    Jul 2011
    Posts
    16

    Default Re: Selected Options on Dropdowns Not Working

    Check your inbox!

  10. #10
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Selected Options on Dropdowns Not Working

    yes, i see it in the test too

    it reminds me of wot formmail does when returning from an error - it clears out the previous selections so that it can set the user's selection

    but we're not returning from an error.

    have u changed FormMail outside the configuration section?

    if so, i think u broke something.....get a fresh copy - best way is to use the upgrade wizard so that it can copy ur configs across.

    if not, report a bug (BUg Reports forum) - i don't think its a bug in Formmail, but you can then discuss it with the tectite author (russell)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Form only works when file uploads have been selected
    By webo in forum Community Support
    Replies: 4
    Last Post: 25-Nov-2009, 10:55 AM
  2. fmbadhandler and selected options
    By goski in forum Community Support
    Replies: 10
    Last Post: 19-Aug-2008, 10:01 PM
  3. Use template based on radio button selected
    By Jamesiv1 in forum Community Support
    Replies: 1
    Last Post: 17-Mar-2008, 11:29 AM
  4. display multiple selected options?
    By Rella in forum Features Questions
    Replies: 1
    Last Post: 08-Nov-2006, 01:23 AM
  5. Using required for select dropdowns?
    By stevie in forum Community Support
    Replies: 1
    Last Post: 08-Feb-2006, 03:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •