I'm new to formtools, ive read all the tutorials for creating forms, creating a single form was a breeze, but the multi-form seems complex.
The tutorial says the form should start with
but when i do this it doesnt do anything, the page just reloads but when i start with
it submits but doesnt redirect to the next page
Heres my first page:
and the next page:
What am i doing wrong?
Api version 2.2.2
The tutorial says the form should start with
PHP Code:
<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
PHP Code:
<form action="http://localhost/formtools/process.php" method="post" enctype="multipart/form-data">
Heres my first page:
PHP Code:
<?php
require_once("global/api/api.php");
//$fields = ft_api_init_form_page("", "test");
$fields = ft_api_init_form_page(3, "initialize");
$params = array(
"submit_button" => "Continue",
"next_page" => "next_page.php",
"form_data" => $_POST,
"file_data" => $_FILES
);
ft_api_process_form($params);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
First Name: <input type="text" name="FirstName" value="<?=htmlspecialchars(@$fields["FirstName"])?>">
<br />
<br />
Last Name: <input type="text" name="LastName" value="<?=htmlspecialchars(@$fields["LastName"])?>">
<br />
<br /><input type="hidden" name="form_tools_initialize_form" value="1" />
<input type="hidden" name="form_tools_form_id" value="3" />
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
and the next page:
PHP Code:
<?php
require_once("global/api/api.php");
//$fields = ft_api_init_form_page();
$fields = ft_api_init_form_page(3, "initialize");
$params = array(
"submit_button" => "Continue",
"next_page" => "next.php",
"form_data" => $_POST,
"file_data" => $_FILES,
"no_sessions_url" => "start.php",
"finalize" => true
);
ft_api_process_form($params);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
Welcome
<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
Address: <input type="text" name="Address" value="">
<br />
<br />
City: <input type="text" name="City" value="">
<br />
<br />
State: <input type="text" name="State" value="">
<br />
<br />
Zip: <input type="text" name="Zip" value="">
<br />
<br />
<input type="submit" name="submit" value="submit">
</form>
</body>
</html>
Api version 2.2.2