FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error Code: #101 - first form submission will not go through
#1
AWESOME new features in FT! Mega props to you, Ben & the team!

I have a bit of a prob - and I apologize in advance if this seems rather amature, but I've searched through the forum and tried various suggestions to no avail.

I setup a new form via the api - however, when I attempt to submit a form I am getting a #101 error.

I removed the "initialize" parameter from the ft_api_init_form_page function:
$fields = ft_api_init_form_page(2); ... am I missing something...? I did add SS Validation and I suspect this may be where the issue lies.

Here is what i've got on the form page:

<?php
require_once("../../../formtools/global/api/api.php");
$fields = ft_api_init_form_page(2);

$errors = array();
if (isset($_POST['JoinNow']))
{
$rules = array();
$rules[] = "required,FirstName,Please enter your first name.";
$rules[] = "required,LastName,Please enter your last name.";
$rules[] = "required,Address1,Please enter your address.";
$rules[] = "required,City,Please enter a city.";
$rules[] = "required,State,Please select a state.";
$rules[] = "required,ZipCode,Please enter your zip code.";
$rules[] = "digits_only,ZipCode,Your zip code can only contain digits.";
$rules[] = "length=5,ZipCode,Your zip code must be 5 digits.";
$rules[] = "digits_only,AreaCode,Your area code can only contain digits.";
$rules[] = "length=3,AreaCode,Your area code must be 3 digits.";
$rules[] = "digits_only,PhoneNumber0,The phone prefix can only contain digits.";
$rules[] = "length=3,PhoneNumber0,The phone prefix must be 3 digits.";
$rules[] = "digits_only,PhoneNumber1,Your phone line can only contain digits.";
$rules[] = "length=4,PhoneNumber1,Your phone line must be 4 digits.";
$rules[] = "required,Email,Please enter your email address.";
$rules[] = "valid_email,Email,Please enter a valid email address.";
$rules[] = "required,AcctPwrd,Please enter a password.";
$rules[] = "same_as,AcctPwrd,VerifAcctPwrd,Please ensure the passwords you enter are the same.";
$rules[] = "required,SecretQuestion,Please enter a secret question.";
$rules[] = "required,SQAnswer,Please enter the answer to your secret question.";
$errors = validate_fields($_POST, $rules);

if (empty($errors))
{
$params = array(
"submit_button" => "JoinNow",
"next_page" => "success.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
}
else
{
$fields = array_merge($_SESSION["form_tools_form"], $_POST);
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>.......... html body here .....

Form action is posting to $_SERVER["PHP_SELF"]
Fields are being refilled - ex:
value="<?=htmlspecialchars($fields["FirstName"])?>"


Any assistance would be greatly appreciated!

PS. success.php (my thank you page) has the proper code in the header as well:

<?php
require_once("../../../formtools/global/api/api.php");
$fields = ft_api_init_form_page();
print_r($fields);
ft_api_clear_form_sessions();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>.............................
Reply
#2
Alright - so it turns out there was an error on the success.php page. Initially, i copy/pasted a client's thank you page since it is for the client and i'm keeping the branding the same. Their page is riddled with invalid code... so I started with a blank sheet of .php and was able to process the form just fine.

I think the error code is misleading though, because it referenced an attempt to reinitialize the form which has already been setup in FT - when in fact it was some unknown code/variable deep within layers of code that was causing the error. i never went back and checked what it was since that would most likely take me weeks. i'll just reconstruct from the new blank slate.

thought i'd share!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)