Form Tools
(Multiform) Cannot move from first form to the next - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: API (https://forums.formtools.org/forumdisplay.php?fid=17)
+--- Thread: (Multiform) Cannot move from first form to the next (/showthread.php?tid=935)



(Multiform) Cannot move from first form to the next - sing0d - Nov 14th, 2010

Hi there,

First a great job on the tool. Really takes my mind off messy php-mysql programming.

Secondly,
I have facing a problem of moving on to the next page after the submission of the first form (http://nmmun.in/nreg/reg.php). The first form's code snippet is,

Code:
<?php
require_once("formtools/global/api/api.php");
$fields = ft_api_init_form_page(2, "initialize");
$params = array(
  "submit_button" => "saveForm",
  "next_page" => "countrysel.php",
  "form_data" => $_POST,
  "no_sessions_url" => "reg.php"
    );
ft_api_process_form($params);
?>

Complete codes are attached alongwith if you want a look.


RE: (Multiform) Cannot move from first form to the next - Ben - Nov 20th, 2010

Hi singOd,

That's curious... what happens, exactly?

The obvious stuff is good:
- your submit button has a name attribute of saveForm
- the <form> start and end tag are valid
- there's no whitespace before the PHP at the top

Is there any JS interfering with the form submit? If you're not sure, try temporarily disabling JS in your browser and re-submitting the form.

- Ben


RE: (Multiform) Cannot move from first form to the next - jpsaenz - Dec 29th, 2010

Hi!

(Nov 20th, 2010, 9:56 AM)Ben Wrote: The obvious stuff is good:
- your submit button has a name attribute of saveForm
- the <form> start and end tag are valid
- there's no whitespace before the PHP at the top
...

Have the same problem... any Ideas?
Greetings!
jp

EDIT: BTW, the "no_sessions_url" function also don't work (i can open every page, but if i click on submit i get a blank page back)

the first 2 fprms are:

01.php

Code:
<?php
require_once("formtools2/global/api/api.php");
$fields = ft_api_init_form_page("", "test");
$params = array(
  "submit_button" => "weiter",
  "next_page" => "02.php",
  "form_data" => $_POST
    );
ft_api_process_form($params);
?>

<html>
<head>
<title>Step 1</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="web/phpwcms_template/inc_css/frontend.css" />
</head>

<body>

<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">

[--cut--]
SOME TEXT
[--cut--]

<input type="hidden" name="Anmeldung genehmigt" value="Noch nicht" />
<input type="hidden" name="GeistigesEigentum" value="JA" />

<input name ="weiter" type="submit" class="mailboxline" value="weiter" />
</form>

</body>
</html>


02.php

Code:
<?php
require_once("formtools2/global/api/api.php");
$fields = ft_api_init_form_page();
$params = array(
  "submit_button" => "weiter",
  "next_page" => "03.php",
  "form_data" => $_POST,
  "no_sessions_url" => "01.php"
    );
ft_api_process_form($params);
?>

<html>
<head>
<title>Step 2</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="web/phpwcms_template/inc_css/frontend.css" />
</head>
<body>

<form action="<?php echo $_SERVER["PHP_SELF"]?>" method="POST">

[--cut--]
THE FORM
[--cut--]

<input name ="weiter" type="submit" class="mailboxline" value="weiter" />
</form>

</body>
</head>



RE: (Multiform) Cannot move from first form to the next - jpsaenz - Dec 29th, 2010

sorry for my insistence, but i realize now that i'm landing allways on the same page; the "header("location: $next_page");" on the api.php seems not to work... i.e., if i try to open the "01.php", i landing on the "01.php" (but the page is blank this time). Any suggestions? Thanks a lot! (and sorry for my poor english...)


RE: (Multiform) Cannot move from first form to the next - jpsaenz - Jan 2nd, 2011

i have found the solution: my php-file was encoded with UTF8. I've converted it to ANSI and it works now. (i can't understand it, but it works...)


RE: (Multiform) Cannot move from first form to the next - lapplander - Jan 2nd, 2011

(Jan 2nd, 2011, 4:34 AM)jpsaenz Wrote: i have found the solution: my php-file was encoded with UTF8. I've converted it to ANSI and it works now. (i can't understand it, but it works...)

I experienced the same problem for 1 of four forms steps. All files where encoded in utf8 and it turned out that I by some reason got mixed charcter encoding in the file even if everything looked just fine. I have to use double byte characters as I need Swedish characters.

The solution where to create a new file in UTF8, copy in all text with single byte characters and write in any double byte characters. And it worked direct.

Even when I had this problem all form submissions where handled correctly in the background but blank page where due to a http response 200 where sent instead of the redirect http 302. So there was some characters in the file that where returned by the page before formtools had a chance to send it's redirect http header.

Tricky problem, so thanks jpsaenz for leading me in right direction Smile