Feedback form error checking

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply

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!

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

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?


Code: Select all

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

With best regards,
Cyril Kobets

Post Reply