I am having trouble with formtools - uswgo - Jan 18th, 2010
I actually got everything set up and when I submit the form data it redirects to the next page but when I check validation it acts as if no data has been sent through.
This is the code I use.
Code: <?php
require_once("/home/uswgo/public_html/formprocessor/global/api/api.php");
$fields = ft_api_init_form_page(3, "initialize");
$params = array(
"submit_button" => "Submit",
"next_page" => "thankyou.php",
"form_data" => $_POST,
"finalize" => true
);
ft_api_process_form($params);
?>
<html>
<head>
<style type="text/css">
body {color:white}
h1 {color:red}
p.ex {color:rgb(0,0,255)}
body {background-image:url('hyipoformbackground2.gif')}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<?php
// if $errors is not empty, the form must have failed one or more validation
// tests. Loop through each and display them on the page for the user
if (!empty($errors))
{
echo "<div class='error'>Please fix the following errors:\n<ul>";
foreach ($errors as $error)
echo "<li>$error</li>\n";
echo "</ul></div>";
}
?>
<FORM ACTION="<?php echo $_SERVER["PHP_SELF"]?>" METHOD="POST">
<H1><font color="RED">Author Application Form</FONT></H1>
<BR><BR>
Your Full Name:<input type="text" size="20" maxlength="30" name="2947947299173"><br />
Why do you want to become an Author:<input type="text" size="30" maxlength="40" name="1093843978482"><br />
If you have a WordPress account then tell me your username or else input no:<input type="text" size="20" maxlength="36" name="2839727828829"><br />
Optional unless you don't have an account - Author Account Name:<input type="text" size="20" maxlength="36" name="1839948929923"><br />
Don't worry about inputing a password because a random generated password will be sent to you then yoiu can change to whatever you want
<BR><BR>
<Font color="white">Tell me a bit about who you are :) don't be shy</font>
<BR>
<textarea rows="8" cols="30" name="comments" value="64822783993472" wrap="physical">Enter your favorite quote!</textarea>:<br />
<BR>
<Font color="white">Comments, suggestions, and more may be</font>
<Font color="white">inputed in the box and will not hurt your chances of becoming an author</font>
<BR><BR>Select the category that suits you:<br />
<select name="5893299288321">
<option value="NWO">New World Order</option>
<option value="USNews">U.S. News</option>
<option value="BigBro">Big Brother</option>
<option value="Commentary">Commentary</option>
<option value="WorldNews">World News</option>
<option value="Multimedia">Multimedia</option>
<option value="Current">Current</option>
<option value="Financial">Financial</option>
<option value="General">General Articles</option>
<option value="Technology">Technology</option>
<option value="Science">Science</option>
<option value="News in Focus">New World Order</option>
<option value="Featured">Featured</option>
<option value="MPWatch">Military Police Watch</option>
<option value="FluWatch">Flu Watch</option>
<option value="BetaStateSecede">(Pending beta)State Secession Watch</option>
</select>
<BR><BR>
Are you against the new world order:<input type="text" size="20" maxlength="36" name="9478886789965"><br />
<BR><BR>
<input type="Submit" id="Submit" name="Submit" value="Submit" style="float: center" />
</form>
I know it's a site about the nwo but please despite your political views just concentrate on the issues instead of getting mad and not helping me. I don't really want to have to edit out all my script just to post it here and may end up keeping you all from helping me.
Just wanted to let you know that because I make a lot of enemies cause of my view points and all I want here is help for my formtools issues. Thats all I want from here. I am not looking for trouble
RE: I am having trouble with formtools - Ben - Jan 30th, 2010
Hi uswgo,
Sorry for the wait! I was away for a week and only managed to get back to the forums today.
You mentioned that when you check validation no data appears to go through, but I didn't see any validation in the code you posted. Would you mind posting the whole thing?
A common problem is that after doing server-side validation on the form field contents, the fields don't get re-entered. For that, give these two tutorials a read through:
http://docs.formtools.org/tutorials/php_validation/
http://docs.formtools.org/tutorials/api_refilling_form_fields/
The first one explains how to get server-side validation added to your API form; the second explains how to re-enter the form fields.
Hope this helps, and good luck with the project.
- Ben
|