want to input errors inside the form like in hotmail

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bugthefixer
Forum Contributor
Posts: 118
Joined: Mon Mar 22, 2004 2:35 am

want to input errors inside the form like in hotmail

Post by bugthefixer »

i hav made an html form and i hav pplied constraints through regular expresions. right now wat happens is when i submit form, if there is wrong input then it shows it in next page..now wat i want is like in hotmail after submitting form..same form comes again with correct inputs already selected and those which hav some wrong input has some red star with it..
anybody can tell me how kan i do it
User avatar
Slippy
Forum Contributor
Posts: 113
Joined: Sat Jul 12, 2003 11:31 pm
Location: Vancouver eh!

Post by Slippy »

Just post to the same form as the original instead of redirecting(posting) to a different page.

You can check for the posted data and handle it as you see fit.

Code: Select all

<!-- FORM.PHP -->
<?php
if ($submit)&#123; echo "You submitted $var"; &#125;
?>

<form action="form.php" method="post">
<input type="text" name="var">
<input type="submit" name="submit" value="submit">
</form>
Post Reply