Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Feedback form error checking

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Postby Jay » Sun Oct 06, 2002 9:47 am

What I do is set the form action to the same page as the form, and use a hidden form field to see if it has been submitted.

if I have a field called name, I do this:
<input type=text name='name' value='<?=@htmlspecialchars($uname)?>'>

So if there is a missing variable, then I'll unset the hidden variable that'll action the info, so it'll redisplay the form. And then I also set all the good variables to the same name with a u in from for 'u'pdate!

Anyways, there's a multitude of ways of doing it, you just need to put a variable for the value in each field, and find a way to manipulate it!
Jay
 

Re: Feedback form error checking

Postby mjr » Mon Oct 07, 2002 6:17 am

JP wrote:My simple php script checks for blank form fields and sends a header to reload the form if a blank field is found. This results in all the correct data being lost and the user has to start again. A "Click the back button" message works but I want to return the user directly to the blank field and retain all the good data. Can anyone help?
JP

use

Code: Select all
<input type=text name=frmLogin value="<?=@htmlspecialchars($frmLogin)?>">


construction
mjr
New php-forum User
New php-forum User
 
Posts: 18
Joined: Fri Sep 27, 2002 6:35 am


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.