Monday, February 23, 2015

Required messaging without complex

This is simple "required  messaging"  to complete the filling form process, once you forget the column to fill data, it will ask to fill the specific column in the same page. 

<html>
<head>
</head>
<body>

<?php
if(isset($_POST['submit'])){

if(empty($_POST['fname'])){
echo "First Name is Required";
}
if(empty($_POST['lname'])){
echo "Last Name is Required";
}
}

?>
<br><br><br>

<form action="post2.php" method="post">
<h1>Required Data</h1>
First Name:<font color=red>*</font> <input type="text" name="fname"><br><br>
Last Name:<font color=red>*</font><input type="text" name="lname"><br><br>
About: <textarea name="about"></textarea><br><br>

<input type="reset" name="reset">
<input type="submit" name="submit" value="Go">

</form>
</body>
</html>

Share this

0 Comment to "Required messaging without complex "

Post a Comment