SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2006
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Small IE6/7 Javascript issue

    Hello all,

    I'm building a small Javascript controller, which you can see in action at http://saltinyourpopcorn.com/signup.html .

    It works fine in Safari and Firefox, as you can see: changing the country causes a change in the region and currency for the ticket price (the other two dropdowns). If you select a country outside of the UK or US, it hides the ticket price and region modules altogether.

    However, when viewed in IE, these two selectors never even appear. I'm sure it's just a small error I made in my Javascript, but not really having much experience with the language I'm having trouble locating it.

    Any help is greatly appreciated, thanks very much.


    Rich

    P.S. I will be creating a non-javascript version of this page later, so don't worry about that part for the moment

  2. #2
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One option you could do, is pass a value into localityControl... your markup might look like this:

    Code:
    <select name="country" id="person_input_country" title="Country" onchange="localityControl(this.value)">
    Then inside localityControl:

    Code:
    function localityControl(selVal) {
    ....
       if (selVal == "United States") { 
    ...
    One other thing might be that IE is picky about explicitly declaring a "value" parameter for each of your <option> tags. I'm testing this now and will post back if my hunch is correct.

    Ok, that seems to be the case. If on your <option> tags you add a "value" parameter it looks to be working, like so:

    Code:
    <option value="United States">United States</option>
    <option value="United Kingdom">United Kingdom</option>

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2006
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh god, adding values to about 300 items is gonna' be fun! I'll try removing most of the countries and regions, try your suggestions and then let you know if it works. Thanks very much, its appreciated

  4. #4
    SitePoint Zealot
    Join Date
    Sep 2006
    Posts
    145
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, it's simply to do with the lack of value on the option tags. Adding the value fixes the problem.

    Thanks again


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
  •