dcsimg
www.webdeveloper.com
Results 1 to 8 of 8

Thread: Setting the response to SELECT element ID works in FF and CHROME but not IE. help!!

  1. #1
    Join Date
    May 2013
    Posts
    6

    Setting the response to SELECT element ID works in FF and CHROME but not IE. help!!

    Here is my HTML SELECT tag.
    -----------------------------
    <select class="validate['required'] text-input" id='plyrstate' name='plyrstate'>
    <option>Select</option>
    <option ></option>
    </select>

    Using mootools ajax request, I am using the following line to set the response to the above id 'plyrstate'.


    $('plyrcity').set('html', response);

    This works fine in FF and CHROME. But IE always displays empty drop down. I alerted the response in IE, it has the values though.

    To fix this I used div tag around the select and tried to set the response on the div. It then displayed the value, but I got in to another issue with getboundclientrect().

    Any help would be greatly appreciated as I have Friday deadline to fix this issue.

    Thanks.

  2. #2
    Join Date
    May 2013
    Posts
    6
    $('plyrcity').set('html', response); This is incorrect. I use the $('plyrstate').set('html', response); which is still not working.

  3. #3
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,671
    Quote Originally Posted by sthaniga View Post
    ...I am using the following line to set the response to the above id 'plyrstate'.


    $('plyrcity').set('html', response);...
    i dont know MooTools but as i can see the two id's not equal. and plz read my signature

  4. #4
    Join Date
    May 2013
    Posts
    6
    Hi I actually setting it correctly on 'plyrstate'. I posted incorrectly in the initial post. Still it does not work. I get empty list. Thanks.

  5. #5
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,671
    any errors shown by IE? where is the page? is it local?

  6. #6
    Join Date
    May 2013
    Posts
    6
    Here is my code:
    HTML/PHP code.
    ---------------
    <select class="validate['required'] text-input" id="plyrcountry" name="plyrcountry">
    <option >Select your country</option>
    <option value=1>India</options><option value=3>Bangladesh</options><option value=2>USA</options><option value=6>Pakistan</options><option value=7>Srilanka</options><option value=12>Australia</options>
    </select>
    </li>

    <li>

    <label for=name>State</label>
    <div id="listofstates">
    <select class="validate['required'] text-input" id="plyrstate" name="plyrstate">
    <option>Select</option>
    <option ></option>
    </select>
    </div>
    </li>




    AJAX - MOOTOOLS call that sets the response. I modified to set the response in div tag because it is not working to set in actual select id 'plyrstate'. If I do this way it is failing in getBoundingClientRech() method in IE while getting the offset.

    window.addEvent('domready', function(){
    $('plyrcountry').addEvent('change', function(event){

    var playerstate = this.getSelected().get("value");
    getplayerstates.cancel().send('plystate=' + playerstate);
    });

    });

    var getplayerstates= new Request({
    method: 'post',
    url: 'getState2.php',
    onSuccess: function(response){
    if(response.indexOf("true")== -1)
    {
    if(Browser.name == 'ie') {
    $('listofstates').set('html',response);
    }
    else
    {
    $('plyrstate').set('html', response);
    }
    }
    else
    {
    alert("error retrieving team list..");
    }
    }
    });

  7. #7
    Join Date
    May 2013
    Posts
    6
    any clue or help would be greatly appreciated developers.

  8. #8
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,671
    getBoundingClientRech() is correctly called getBoundingClientRect()... you need somebody who knows this mootools i'm mostly into jquery sorry i'm not familiar with the mootools...

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



Recent Articles