Property in Qatar - WoW Gold - Prefessional Book Reviews - Web Hosting - Debt Consolidation

PDA

View Full Version : NO book i read did sticky form correctly


winterheat
Oct 13th 2007, 5:34 am
the sticky form is that if validation didn't pass, re-display the form with the value in the text input again (and for other input field as well...)

no book I read did it correctly so far. (just for the text input)

to reduce the problem, how about write a PHP program that will submit to itself, so that

typing in

foo "bar" foo

and click "Submit" and the form will re-display the form with

foo "bar" foo

already typed in, kind of like what Google will behave.

the program should also work with foo 'bar' foo

Of the few books I read, none of them has a correct solution. If you know which book has a correct solution to this, please point me to it.

nico_swd
Oct 13th 2007, 7:08 am
Are you actually asking for something? I'm somewhat confused by this.

tandac
Oct 13th 2007, 9:53 am
I think he's how to create a "sticky" form. The idea being, if you fill in the form incorrectly it redisplays with appropriate error messages and the same values filled in.

Since the poster seems to be looking to learn rather than a specific solution, I'll suggest looking at the $_POST variable and this example:
<input type="text" name="name" value="<?php echo $_POST['name']; ?>" />

winterheat
Oct 13th 2007, 5:01 pm
i am asking why all the examples of "sticky form"

if you type in

foo "bar" foo

in the box, it won't come back as

foo "bar" foo

nico_swd
Oct 13th 2007, 5:29 pm
You mean unlike this one?

http://www.wellho.net/demo/myform.php

Brewster
Oct 14th 2007, 2:29 am
If you post the code for a "sticky form" that doesnt "stick" that would be helpful for us to help you.

Brew