
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript">
function"WebContent/user.jsp" formValidator()
{
var a=document.f1.First_name.value;
var b=document.f1.password.value;
if(isNumeric(a, "Please enter only Alphabet for your Product Name"))
{
var numericExpression = /^[0-9]+$/;
if(a.value.match(numericExpression)){
return true;
}else{
alert(helperMsg);
return false;
}}
if(a==null||a=="")
{
alert("first name must be filled out");
return false;
}
if(b==null||b=="")
{
alert("Quantity must be filled out");
return false;
}
}
function isNumeric(elem, helperMsg){
var numericExpression = /^[0-9]+$/;
if(elem.value.match(numericExpression)){
return true;
}else{
alert(helperMsg);
return false;
}
}
</script>
<title>Insert title here</title>
</head>
<body>
<table align="center">
<h1> Registration Form </h1>
<br>
<form name="f1" method="post" onsubmit='return formValidator()' action="Login">
<tr><td> First Name: </td><td><input type="text" name="First_name" maxlength="20"></td></tr>
<tr><td> Password: </td><td><input type="password" name="password" maxlength="20"></td></tr>
<td><input type="submit" value="submit"></input></td>
<td><input type="reset" value="reset"></input></td>
</form>
</table>
</body>
</html>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.