SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem with html Select control in IE

    hi,
    I am using a javascript popup calendar. It has one SELECT control in it. its not getting displayed in IE but works fine in Mozilla. Can anyone pls help me out?

    temp="<select name=\"ampm\" class='time-style'>\n"
    temp+="<option "+SelectAm+" value=\"AM\">AM</option>"
    temp+="<option "+SelectPm+" value=\"PM\">PM</option>"
    temp+="</select>"
    document.getElementById("txtTime").innerHTML = temp

  2. #2
    SitePoint Enthusiast
    Join Date
    Sep 2008
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know how you use the code (for example: how do you run it, what's the time-style css definition).

    But the following runs fine (maybe it helps):

    <html>
    <head>
    <script>
    function test()
    {
    var SelectAm = "AM";
    var SelectPm = "PM";
    var temp="<select name=\"ampm\" class='time-style'>\n"
    temp+="<option "+SelectAm+" value=\"AM\">AM</option>"
    temp+="<option "+SelectPm+" value=\"PM\">PM</option>"
    temp+="</select>"
    document.getElementById("txtTime").innerHTML = temp;
    }
    </script>
    </head>
    <body onload=test()>
    <span id="txtTime"></span>
    </body>
    </html>
    Last edited by th76; Oct 6, 2008 at 13:26.
    Teun Hoogendoorn
    ATSC
    LinkedIn
    Blog


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
  •