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
want to input errors inside the form like in hotmail
Moderator: General Moderators
-
bugthefixer
- Forum Contributor
- Posts: 118
- Joined: Mon Mar 22, 2004 2:35 am
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.
You can check for the posted data and handle it as you see fit.
Code: Select all
<!-- FORM.PHP -->
<?php
if ($submit){ echo "You submitted $var"; }
?>
<form action="form.php" method="post">
<input type="text" name="var">
<input type="submit" name="submit" value="submit">
</form>