my crud script not working in IE but works well with Firefox.

my crud script not working in IE but works well with Firefox.

Hello Every one.

Thanks in advance for creating this Forum and thanks in advance to all who had solved others problem.

I am a new to jquery scripting. I got this script from one of the forum and modified it to meet my purpose.
Addition and deletion works well with this script but problem arises when coming to deletion of records.
Please get me out of this problem. though this script works well in Firefox it is not working in IE. please let me know about the error in the script.

update.php   
  1. <?php

        $hostname="localhost";
        $username="root";
        $password="";
        $dbname="xyz";
       
        $conn = mysql_connect($hostname,$username,$password) or die ('Not Connecting to the database');
        @mysql_select_db($dbname) or die ('Not accessing table');
       
        // CLIENT INFORMATION
        $actnam = htmlspecialchars(trim($_POST['actnam']));
        $actres = htmlspecialchars(trim($_POST['actres']));
        $actdat = htmlspecialchars(trim($_POST['actdat']));
        $actsta = htmlspecialchars(trim($_POST['actsta']));
        $actcom = htmlspecialchars(trim($_POST['actcom']));
        $idvaluein = htmlspecialchars(trim($_POST['id']));

        $rem  = "UPDATE act_tab SET act_nam='$actnam',act_res='$actres',act_dat='$actdat',act_sta='$actsta',cct_com='$actcom' WHERE slno='$idvaluein'";
      
     mysql_query($rem) or die(mysql_error());
    mysql_close($conn);
    ?>

























update-form.php
  1. <?php
    $hostname="localhost";
    $username="root";
    $password="";
    $dbname="xyz";

    $conn = mysql_connect($hostname,$username,$password) or die ('Not Connecting to the database');
    @mysql_select_db($dbname) or die ('Not accessing table');

    $idvalue=substr($_GET['id'],7);

    $sql="SELECT * FROM act_tab WHERE slno='$idvalue'";

    $query=mysql_query($sql);

    $result = mysql_fetch_assoc($query);

    ?>
    <form id="updateform" method="post"> 
        <fieldset>
            <legend>Update Activity</legend> 
            <label for="actnam_update">Activity       :</label><input id="actnam_update" name="actnam_update" class="text" size="20" type="text" value="<?php echo $result['act_nam']; ?>">
            <label for="actres_update">Responsibility :</label><input id="actres_update" name="actres_update" class="text" size="20" type="text" value="<?php echo $result['act_res']; ?>">
            <label for="actdat_update">Date           :</label><input id="actdat_update" name="actdat_update" class="text" size="10" type="text" value="<?php echo $result['act_dat']; ?>">
        <label for="actsta_update">status         :</label><input id="actsta_update" name="actsta_update" class="text" size="20" type="text" value="<?php echo $result['act_sta']; ?>">
        <label for="actcom_update">Comments       :</label><input id="actcom_update" name="actcom_update" class="text" size="20" type="text" value="<?php echo $result['cct_com']; ?>">
            <input id="id_update"  size="20" type="hidden" value="<?php echo $result['slno']; ?>">
        <input type="submit" value="Update">        
        </fieldset>
    </form> 

































  1. <html>
    <head>
    <title>Testing AJAX</title>
    <script type="text/javascript" src="jquery.js"></script>
    </head>
    <body>
    <div class="container"> 
        <form id="submit" method="post"> 
            <fieldset> 
                <legend>Enter Information</legend> 
                <label for="actnam" >Activity       : </label><input id="actnam" name="actnam" class="text" size="20" type="text">
                <label for="actres" >Responsibility : </label><input id="actres" name="actres" class="text" size="20" type="text">
                <label for="actdat" >DAte           : </label><input id="actdat" name="actdat" class="text" size="10" type="text">
                <label for="actsta" >status         : </label><input id="actsta" name="actsta" class="text" size="20" type="text">
                <label for="actcom" >comments       : </label><input id="actcom" name="actcom" class="text" size="20" type="text">
            <input type="submit" value="Add">
            </fieldset>
        </form> 
        <div class="name_list"></div>
        <div class="update_form"></div> 
    </div>

    <script type="text/javascript">

    $(document).ready(function(){
       
            function loadList(){
            // load list start
                    $.ajax({
                        url: "load-list.php",
                        cache: false,
                        success : function(html){
                                $(".name_list").html(html);
                                    }
                             });
                }
           
    loadList();

       
            $("form#submit").submit(function() {
            // we want to store the values from the form input box, then send via ajax below
                var x=window.confirm("Are you sure you want to delete this item?")
                var actnam = $('#actnam').attr('value');
                var actres = $('#actres').attr('value');
                var actdat = $('#actdat').attr('value');
                var actsta = $('#actsta').attr('value');
                var actcom = $('#actcom').attr('value');
                if (x==true){
                             $.ajax({
                        type: "POST",
                        url: "save.php",
                        data: "actnam="+ actnam +"& actres="+ actres +"& actdat="+ actdat + "& actsta="+ actsta +"& actcom="+ actcom,
                        success: function(){
                                loadList();
                                       }
                                    });
                          }
                return false;
            });
       
            $(".delete_button").live("click", function(){
                //this deletes the row clicked on with an alert and then reloads the list
                var idvaluein = $(this).attr("id");
                var x=window.confirm("Are you sure you want to delete this item?");
                    if (x==true){
                         $.ajax({
                        type: "POST",
                        url: "delete.php",
                        data: "id="+ idvaluein,
                        success: function(){
                                loadList();
                                    }
                                 });
                                  }
                return false;
            });
       
            $(".update_button").live("click", function(){
                //this loads the update form
                var idvaluein = $(this).attr("id");
                var x=window.confirm("Are you sure you want to update this item?");
                if (x==true){
                alert(idvaluein);
                $.ajax({
                   
                    url: "update-form.php",
                    data: "id="+ idvaluein,
                    cache: false,
                    success: function(html){
                            $(".update_form").html(html);
                                }
                            });
                    }
                return false;
            });
       

             $("form#updateform").live("submit", function(){
                         var actnam = $('#actnam_update').attr('value');
                            var actres = $('#actres_update').attr('value');
                            var actdat = $('#actdat_update').attr('value');
                        var actsta = $('#actsta_update').attr('value');
                        var actcom = $('#actcom_update').attr('value');
                        var idvaluein = $('#id_update').attr('value');
                $.ajax({
                    type: "POST",
                    url: "update.php",
                    data: "actnam="+ actnam +"& actres="+ actres +"& actdat="+ actdat +"& actsta="+ actsta +"& actcom="+ actcom+"& id="+ idvaluein,
                    success: function(){
                        $(".update_form").empty();
                        loadList();
                    }
                });
                 return false;
       
            });


    });
    </script>
    </body>
    </html>