Aug 28th, 2010, 8:17 AM
Hey villjam,
Sorry for not getting back to you sooner!
Yeah, JS would work. The other option is to do it with PHP.
Whenever you have multiple submit buttons in the page, any time you submit the form the POST/GET request will contain a name-value pair for ONLY the submit button you clicked. This is really handy, since you can use it in the PHP to figure out which was clicked.
So in your code, assuming your 3 submit buttons had the name attributes of "submit1", "submit2" and "submit3" you could do something like this:
Just FYI!
- Ben
Sorry for not getting back to you sooner!
Yeah, JS would work. The other option is to do it with PHP.
Whenever you have multiple submit buttons in the page, any time you submit the form the POST/GET request will contain a name-value pair for ONLY the submit button you clicked. This is really handy, since you can use it in the PHP to figure out which was clicked.
So in your code, assuming your 3 submit buttons had the name attributes of "submit1", "submit2" and "submit3" you could do something like this:
PHP Code:
<?php
require_once("form_tool/global/api/api.php");
$fields = ft_api_init_form_page("", "test");
$params = array(
"form_data" => $_POST
);
if (isset($_POST["submit1"]))
{
$params["submit_button"] = "submit1";
$params["next_page"] = "page1.php";
}
else if (isset($_POST["submit2"]))
{
$params["submit_button"] = "submit2";
$params["next_page"] = "page2.php";
}
else if (isset($_POST["submit2"]))
{
$params["submit_button"] = "submit3";
$params["next_page"] = "page3.php";
}
ft_api_process_form($params);
?>
Just FYI!
- Ben