Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8243137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:24:42+00:00 2026-06-07T21:24:42+00:00

I have a parent page which has a drop down list in it. using

  • 0

I have a parent page which has a drop down list in it. using the onchange event, data is posted to a second page using $.post(). This page uses the posted variables to output mysql data with a checkbox for each line. This page output is then inserted into the parent page using jquery $('#DIV name').html(output).show();

The user can then see the mysql table rows with corresponding checkboxes. They then select the checkboxes they want and say delete. Delete is a form submit button.

My question is, when they click delete how do I take the form data from the second page and post it with that of the parent page so that I can then use $_POST[] to get the checkbox info and delete the selected table rows?

example of the parent page code is:

javascript/jquery

<script type="text/javascript">
        function get(row){      //row being processed, defined in onchange="get(x)"
            ('getpeopleinjobs.php',{        //data posted to external page
        postvarposition: form["position"+row].value,        //variable equal to input box, sent to external page
        postvarjob: form["job"+row].value,      //variable equal to input box, sent to external page
        postvarperson: form["person"+row].value,        //variable equal to drop down list, sent to external page
        postrow: row},      //variable equal row being processed, sent to external page
            function(output){ 
                $('#training'+row).html(output).show();     //display external results in row div
                //popupWindow = window.open('t4.php?variable1Name=Vicki&amp;variable2Name=Maulline','popUpWindow','height=400,width=1000,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes')
                    });
                }
</script>

Form data is

 <tr>
    <td>
    <?PHP echo $i; ?>
    </td>
    <td>
        <input type=text NAME="position<?PHP echo $i; ?>" id="position<?PHP echo $i; ?>"  style="border: 1px solid #2608c3;color:red; width=200px" value="<? echo mysql_result($resultpositionjob,$r,0);?>"> 
    </td>
    <td>
        <input type=text NAME="job<?PHP echo $i; ?>" id="job<?PHP echo $i; ?>"  style="border: 1px solid #2608c3;color:red; width=200px" value="<? echo mysql_result($resultpositionjob,$r,1);?>"> 
    </td>
    <td>
        <SELECT NAME="person<?PHP echo $i; ?>" id="person<?PHP echo $i; ?>" style="border: 1px solid #2608c3;color:red; width=200px" onchange="get(<? echo $i; ?>);"> 
        <OPTION VALUE=0 >
        <?=$optionpeople?> 
        </SELECT>
    </td>
    <td onclick="train(<? echo $i; ?>);" style="color:grey; cursor: pointer;">
    <div id="training<?PHP echo $i; ?>"><font color=grey size=2></div>
    </td>
    <td>
        &nbsp;
    </td>
    </tr>
    <?PHP
        $i++;
        $r++;
        }
    ?>

The second page or page called by jquery, the output is:

        echo 
        "
        <table border=0 width=400>
            <tr>
                <td width=20>
                    &nbsp;
                </td>
                <td width=150>
                    <b>Position<b>
                </td>
                <td>
                    <b>Job<b>
                </td>
            </tr>
        ";
        while($line = mysql_fetch_array($result))
   {
        echo "
            <tr>
                <td>
                ";
        ?>
        <input type=checkbox name="delete[]" id="delete[]" value="<?php echo $rows['id']; ?>">
        <?PHP
        echo    "
                </td>
                <td>
                ";
        echo $line['position'];
        echo    "
                </td>
                <td>
                ";
        echo $line['job'];
        echo    "
                </td>           
            </tr>
            ";
        } 
            ?>
            <tr>
                <td>
                    <input type=submit name="update" id="update" value="Update">
                </td>
            </tr>
        </table>
        <?PHP       
 }

To repeat I want the table checkbox element from the second page posted with the form data of the parent page.

Is this possible as my testing hasnt given me any luck.

Am I doing something wrong or do I need to modify the jquery code?

Thanks as always for the assistance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T21:24:45+00:00Added an answer on June 7, 2026 at 9:24 pm

    There is no second page. Really – you’re loading HTML content from the second page, but it’s being inserted into the parent page. All content, from your browsers perspective, is in the same page. The fields should be included as long as they’re inside the DOM inside the element. Use the developer tools for your browser or Firebug for Firefox to make sure that the content is placed within the form element in the DOM. The developer tools should also be able to show you exactly which variables are submitted to the server when the form is submitted.

    The ‘action’ parameter of ‘form’ will indicate where the content gets submitted (and it seems you’ve left that part out of your HTML, so it’s impossible to say if you’ve left out or just not included it in the paste.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a parent object called Page that has a List of objects called
I have an aspx master/content page scenario. The parent page has an IFrame which
I have a parent page which has an iframe and also has javascript which
I have an iframe which contains a few select drop-down lists for data entry.
I have a dynamic page which has a parent div called 'divWiz' where I
I have a parent component, say P, which has function, say Pfunc. I also
Here is a problem I have encountered. I have jsp page which has a
Setup: I am using JSPs and jQuery. There is a 'parent' page which holds
I have a gridview inside updated panel on parent page which is populated based
I have a page which needs to use $.post() but for some reason the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.