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
null submissions, not finalized
#3
By using PHP validation and changing the position of the ft_api_init_form_page() function as per the following sample code, I found I was able to create database entries but only when the form is submitted.

PHP Code:
<?php

require_once("/httpdocs/formtools/global/api/api.php");

if(isset(
$_POST['form_submitted']))
{
  
$rules = array();
  
$errors = array();

  
$rules[] = "required,fm_name,Please enter your name.";
  
$rules[] = "required,fm_email,Please enter your email address.";
  
$rules[] = "valid_email,fm_email,Please enter a valid email address.";
  
$rules[] = "required,fm_subject,Please enter a subject.";
  
$rules[] = "required,fm_message,Please enter a message.";

  
$errors validate_fields($_POST$rules);

  if(empty(
$errors))
  {
    
$fields ft_api_init_form_page(1);

    
$params = array(
      
"submit_button" => "form_submitted",
      
"next_page" => "thankyou.php",
      
"form_data" => $_POST,
      
"finalize" => true
    
);

    
ft_api_process_form($params);
  }
}
?>
Reply


Messages In This Thread
null submissions, not finalized - by Alexis - Jun 30th, 2009, 9:12 AM
RE: null submissions, not finalized - by Alexis - Jun 30th, 2009, 2:41 PM
RE: null submissions, not finalized - by cssmw - Aug 10th, 2009, 10:25 AM
RE: null submissions, not finalized - by Ben - Aug 15th, 2009, 2:16 PM
RE: null submissions, not finalized - by cssmw - Aug 17th, 2009, 5:06 AM
RE: null submissions, not finalized - by Ben - Aug 21st, 2009, 8:17 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)