JSFiddle - React, Tailwind, and code Playground
by Dedi Wibisono
HTML
<title>
User Validation : 2nd Program
</title>
<script type="text/javascript">
function validate()
{
if(form.username.value == "sample" && form.password.value =="password")
{
alert("User Validated ");
return true;
}
else
{
alert("Incorrect Username or Password" );
return false;
}
}
</script>
</head>
<body>
<text align=center>
<form name="form" onsubmit="return validate();">
Username <input type="text" name="username" />
<br />
<br />
Password <input type="password" name="password" maxlength=10 />
<input type="submit" />
</form>