SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Jquery chained Selecbox problem in IE6,IE7,IE8.

    Hi,

    I am using a code for chained select box. Its doing great in IE9, IE10, chrome, FF.

    first select box is coming up based on that second is not displaying for IE6, IE7,IE8. Please let me know how to identify the issue.

    Following is the code:

    <?php
    /**************************************
    Page load dropdown results
    **************************************/
    function getTierOne()
    {

    $result = mysql_query("select distinct cmp_city from company where status='active' order by cmp_city")
    or die(mysql_error());

    while($tier = mysql_fetch_array( $result ))

    {
    echo '<option value='.$tier['cmp_city'].'>'.$tier['cmp_city'].'</option>';
    }

    }

    /**************************************
    First selection results
    **************************************/
    if(isset($_GET['func'])&& $_GET['func'] == 'drop_1' ) {
    drop_1($_GET['drop_var']);
    }

    function drop_1($drop_var)
    {

    echo "<script type=\"text/javascript\">
    $(document).ready(function() {
    $('#wait_2').hide();
    $('#drop_2').change(function(){
    $('#wait_2').show();
    $('#result_2').hide();
    $.get(\"func.php\", {
    func: \"drop_2\",
    drop_var: $('#drop_2').val()
    }, function(response){
    $('#result_2').fadeOut();
    setTimeout(\"finishAjax_tier_three('result_2', '\"+escape(response)+\"')\", 400);
    });
    return false;
    });
    });

    function finishAjax_tier_three(id, response) {
    $('#wait_2').hide();
    $('#'+id).html(unescape(response));
    $('#'+id).fadeIn();
    }
    </script>";
    $result = mysql_query("SELECT DISTINCT cmp_name,cmp_branch FROM company WHERE cmp_city='$drop_var' AND user_type = '3' order by cmp_branch") or die(mysql_error());
    echo '<select name = "userid" id = "drop_2" class = "required">
    <option value = " "> Choose Agent </option> ';
    while($drop_2 = mysql_fetch_array( $result )) {
    echo '<option value = "'.$drop_2['cmp_name'].'">'.$drop_2['cmp_branch'].' - '.$drop_2['cmp_name'].'</option>';
    }
    echo '</select></td>';


    }


    /**************************************
    Second selection results
    **************************************/

    if(isset($_GET['func'])&& $_GET['func'] == 'drop_2' ) {
    drop_2($_GET['drop_var']);
    }
    function drop_2($drop_var)
    {

    $result = mysql_query("SELECT * FROM company where cmp_name = '$drop_var'") or die(mysql_error());
    while($drop_3 = mysql_fetch_array( $result )) {
    echo '</td></tr><td colspan = "3">Telephone : <input type = "text" name = "userTelephone" value = "'.$drop_3['cmp_phone'].'" readonly = readonly class = "required"</td>';
    echo '<td colspan = "3"> Address : <textarea rows = "2" cols = "60" name = "userAddress" readonly = readonly class = "required" > '.$drop_3['cmp_address'].' </textarea> </td></tr>';
    break;
    }
    }

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    What is the HTML and JavaScript code that is generated for the page? It will be much easier for us to determine what is going on if we can see that instead.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Member
    Join Date
    Aug 2013
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Paul,

    Thank you for responding my question. When I checked from F12 developer toolbar I found document mode was IE5 quirk.

    I am using <?php header('X-UA-Compatible: IE=edge'); ?>

    as solution to it since in standard mode its working fine.


Tags for this Thread

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
  •