Question


Jayesh

how to javascript validation in form?

Date = 2015-03-26

<form action="check.php" onSubmit="return validation_form()" name="registration" method="post">

Name : <input type="text" name="first_name">
<input type="submit" value="Submit">
</form>

Comments by experts


Rajesh Kakadiya
Date = 2015-03-26

function validation_form() 

{
    var fn = document.forms["registration"]["first_name"].value;
    if (fn == "")
   {
        alert("Please fill your First Name !!!");
        return false;
    }
}


Type your Comment below and click to send comment