Thursday, August 15, 2019

JavaScript Validation Form

A simple javascript code to validate the HTML form using javascript as our programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Sample Program Output


Program Listing

index.htm

<html>
<head>
<title>Javascript Validation</title>
</head>
<script>
function validate_form() 
{
var u_name = document.frmname.uname;
var f_name = document.frmname.fname;
if (u_name.value=="" || u_name.value==null)
{
alert("please specify username");
u_name.focus();
return false;
}
else if (f_name.value=="" || f_name.value==null)
{
alert("please specify first name");
f_name.focus();
return false;
}
}
</script>
<body>

<form method="post" onSubmit="return validate_form(this)" name="frmname">
Username <input type="text" name="uname"><br>
First Name<input type="text" name="fname"><br>
<input type="submit" name="submit">
</form>
</body>
</html>





No comments:

Post a Comment