Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [PEAR] TrackSubmit question
On 5/27/05, Lionel Worman <lworman@wittenberg.edu> wrote:
> I'm having some trouble working with the $trackSubmit option of
> HTML_Quickform. The documentation mentions the following about it:
>=20
> "boolean $trackSubmit
>=20
>     (optional) Whether to track if the form was submitted by adding a
> special hidden field. If the name of such field is not present in the $_G=
ET
> or $_POST values, the form will be considered as not submitted. "
>=20
> 1st Question: is meant by adding a special hidden field, and how do I tak=
e
> advantage of it?

trackSubmit automatically puts a hidden value in the form and the form
won't validate if that value isn't in the submitted values. You don't
have to do anything special to use it. It's mostly there so that you
can have 2 forms on one page so that QF can know which one was
submitted.

>=20
> 2nd Question: I've set up the following page so that it requires somethin=
g
> be typed into the Text field entered_text. If the form is valid it should
> post to the next page (form2.php). The problem is that as long as I have =
it
> POST or GET to another page, it skips the validation. It skips the
> validation no matter what I put in for tracksubmit.

Well, this is because you're posting to form2.php, which doesn't check
to see if form1.php is valid. PHP scripts are run completely, the
output is sent to the browser, and the browser sends a response back.
In this case, the browser is sending the response to form2.php, which
isn't dealing with the submit of the first form.

A better solution would be to leave the action alone and let the form
submit to the page that created it (this is the "right" way to do it).
Then the validation will work. If the form validates, process the
data, then redirect to the second for with a header('Location:
http://...');

--=20
Justin Patrin

Report this thread to moderator Post Follow-up to this message
Old Post
Justin Patrin
05-28-05 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Pear archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:35 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.