i have 3 form on a page and unfortunately i am not allowed to change that. the problem is when the third form is submitted, i would need to grab the data displayed from the second form to update the database incase the user changed anything on it. does anyone have any idea how i can trigger a second form to get submitted when a form is submitted?

Member Avatar for diafol

Is the data in form 2 used to change the displayed data in form 3?
You could make this a single form with 3 submit buttons, each with a different id/name (e.g. submit1,submit2,submit3).

You then check for $_POST or $_POST or $_POST.

Every field in the form is passed with each submit button, but you only need to extract the fields you want with conditional statements in your form handling routine:

if(isset($_POST['submit1'])){
 ...blah blah...
}elseif(isset($_POST['submit2'])){
 ...blah blah...
}else{
 ...blah blah...
}
Be a part of the DaniWeb community

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