Posts: 1
Threads: 1
Joined: Apr 2012
Reputation:
0
Apr 4th, 2012, 11:54 AM
(This post was last modified: Apr 4th, 2012, 12:11 PM by xtreem88.)
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
PHP Code:
<?php
<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">
but when i do this it doesnt do anything, the page just reloads but when i start with
PHP Code:
<?php
<form action="http://localhost/formtools/process.php" method="post" enctype="multipart/form-data">
it submits but doesnt redirect to the next page
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>