For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > February 2006 > HTML_QuickForm









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author HTML_QuickForm
akhan

2006-02-26, 6:58 pm


When I try to post to another page test.html, HTML_QuickForm does not seem to
validate the form.

<?php
require_once("HTML/QuickForm.php");

// Create new instance - Form
$Form = new HTML_QuickForm("Form1", "POST", 'test.html');
$Form->addElement("Text", "Name1", "Text1", array("size" => "30"));
$Form->addElement("Submit", "Button", "A");

$AForm->addRule("Name1", 'Please Enter', 'required');
if ($Form->validate())
{
$Form->submitValues();
}

// Display Forms
$Form->display();
--
View this message in context: http://www.nabble.com/HTML_QuickFor...3.html#a3134145
Sent from the Pear - General forum at Nabble.com.
Mark Wiesemann

2006-02-26, 6:58 pm

akhan wrote:

> When I try to post to another page test.html, HTML_QuickForm does not seem to
> validate the form.
>
> <?php
> require_once("HTML/QuickForm.php");
>
> // Create new instance - Form
> $Form = new HTML_QuickForm("Form1", "POST", 'test.html');


This can't work as you expect. The form target needs to be script where
the form is defined. After validating the form, you can redirect to your
test.html (or include it).

HTH,
Mark
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com