Hi there,

I need a help on how to pass php variable to another page when the checkbox is clicked. so far i hav this

        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
        <script type="text/javascript">

        $('.cuttingCheckbox').change(function() {
            if (this.checked) {
                 $.post('fabProcess.php', {
                 headmark : $($row[HEADMARK]).val(),
                 headmark_id : $($row[ID]).val()
            }, function(response){
                 this.setAttribute("disabled", true),

        $('.assemblyCheckbox').change(function() {
             if (this.checked) {
               this.setAttribute("disabled", true);


        <link rel="stylesheet" type="text/css" href="../css/showFab.css">


    if($_POST['action'] == 'show')
                          WHERE SUB_MASTER_DRAWING.HEAD_MARK = '{$_POST["hm"]}'";

        $query = oci_parse($conn, $sql);
                $query_exec = oci_execute($query);

               echo "<table border='1'>";
        while($row = oci_fetch_assoc($query)){

            echo '<div id="content">';
                            echo '<table cellspacing = "0"';
                                echo '<tr><th>Head Mark</th>


                                echo "<tr><td><b>$row[HEAD_MARK]/$row[ID]</b></td>";

                                          if ($row['CUTTING'] == 'Y'){                                   
                                              echo "<td><input type='checkbox' id='cuttingCheckbox'  name='cuttingCheckbox' checked='checked' disabled='disabled'/></td>";
                                          } else {
                                              echo "<td><input type='checkbox' class='cuttingCheckbox'  name='cuttingCheckbox' /></td>";

                                          if ($row['ASSEMBLY'] == 'Y'){                                   
                                              echo "<td><input type='checkbox' id='assemblyCheckbox'  name='check' checked='checked' disabled='disabled'/></td>";
                                          } else {
                                              echo "<td><input type='checkbox' class='assemblyCheckbox'  name='check' /></td>";
                                        echo "</tr>";     
                                echo '<table cellspacing = "0"';
                        echo '</div>';}
        echo "</table>";
     }//===> END OF 'SHOW'

So basically it shows occurence from the database and I want to pass $row[HEADMARK] and $row[ID] to another page for updating the value to database.

Please help me, any kind of help will greatly appreciated

Re: Sending PHP variable to another page using jquery 80 80

What is not working for you?
the best way to pass your form variables is to serialize them.

var formdata=$("#formid").serialize();

$('.cuttingCheckbox').change(function() {
            if (this.checked) {
                 $.post('fabProcess.php', data: formdata, function(response){
                 this.setAttribute("disabled", true)

ps: in your current codethis.setAttribute("disabled", true), should have a semicolon after it rather than a comma.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.