heartily regards from me I need to retain values in text boxes after submit button on click if found error. basically the thing I want, if user left any fields blank and press save button then error message pop up and without refreshing the page it takes back the user to the form where he just have to fill the fields that were left blank... below is my code
<html>
<form method="post" action="">
Enter Name : <input type="text" name="name" /><br/>
Enter Password : <input type="password" name="pass" /><br/>
<input type="submit" name="save" value="Save" />
</form>
</html>
php code
<?php
if (isset($_POST["save"]))
{
$name = $_POST["name"];
$pass = $_POST["pass"];
if (($name == '') && ($pass == ''))
{
echo "Fields Must Be Filled...";
exit();
}
if ($name == '') {
echo "Enter Name...";
exit();
}
if ($pass == '') {
echo "Enter Password...";
exit();
}
else
{
echo "Your name " . $name;
echo "<br/>";
echo "Your Password " . $pass;
}
}
?>