The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 871 - File: showthread.php PHP 7.4.12 (Linux)
File Line Function
/showthread.php 871 errorHandler->error


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
[FIXED] non-valid entries return empty form
All fields are empty when validation returns the form to the first (the one) page.
Thank you page is displayed correctly and submission is successful if form is validated.

Error message shows fine. You can see it working at (it's an iframe, because self-submitting the form didn't work due to permalinks / rewrite on wordpress page)

my form is

PHP Code:

$errors = array();
if (isset(
$_POST) && !empty($_POST))
$rules = array();
$rules[] = "required,name,Please enter your name.";
$rules[] = "required,email,Please enter your email address.";
$rules[] = "valid_email,email,Please enter a valid email address.";
$errors validate_fields($_POST$rules);

if (empty(
$fields ft_api_init_form_page(9);
$params = array(
"submit_button" => "contact_submit",
"next_page" => "thankyou.php",
"form_data" => $_POST,
"finalize" => true
<div id="contactform_div">
if (!empty($errors))
"<div class='error'>Please correct the following errors, and resubmit the form:"
    foreach (
$errors as $error)
"</ul></div><br />"
  <form id="contactform" action="<?php echo $_SERVER["PHP_SELF"]?>" method="post" onsubmit="contactform_processing()">
<label>Name:<input name="name" type="text" id="name" value="<?=@$fields['name']?>" size="35" /></label>
<label>E-Mail:<input name="email" type="text" id="email" value="<?=@$fields['email']?>" size="35" /></label>
<label>Comments:<br /><textarea id="comments" cols="40" rows="10" name="comments"><?=@$fields['comments']?></textarea></label>
<input name="report" id="report" value="1." <?php if (@$fields['report'] == '1') echo '1'?> type="checkbox"> 
<span class="warningred">I want my FREE SEO Preliminary Report *</span>
<label>Website:<input name="website" type="text" value="<?=@$fields['website']?>" size="35"></label>
<?php ft_api_display_captcha(); ?><input type="submit" value="Submit" name="contact_submit"> 

Messages In This Thread
[FIXED] non-valid entries return empty form - by sergiozambrano - Jun 30th, 2009, 12:34 AM
[STILL NOT WORKING] - by sergiozambrano - Aug 14th, 2009, 6:03 AM
RE: non-valid entries return empty form - by Ben - Aug 16th, 2009, 10:41 AM
[SOLVED] - by sergiozambrano - Aug 18th, 2009, 6:39 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)