Using an example explain the concept of Form Validation in Java.



<html>
<head><title>Form Validation</title>
<script language="Javascript">
function f(x)
{
t=x.n.value;
l=t.length
if(l>7)
alert("Invalid Phone no.");
else
alert("Valid Phone no.");
}
</script>
</head
><body>
<form>
Enter your Phone number<input type="text" name="n">
<input type="button" value="ok" onClick="f(this.form)">
</form>
</body>
</html>

Comments

Popular posts from this blog

Write a program to add two number using inline function in C++?

Traversing of elements program with algorithm and Flowchart