
vivek i want to crate a webpage with specfic email id and password to that webpage . using jsp & servlets

Hi Friend,
Try the following code:
<html>
<script>
function checkMail(form,email){
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var address = document.forms[form].elements[email].value;
if(reg.test(address) == false) {
alert('Invalid Email Address');
document.getElementById('email').value="";
return false;
}
}
function validate(){
checkMail('form','email');
var pass=document.getElementById('pass').value;
if(pass.length<6){
alert('Password should be of atleast 6 characters');
document.getElementById('pass').value="";
return false;
}
}
</script>
<form id="form" method="post" onsubmit="javascript:return validate();">
<table>
<tr><td>Email </td><td><input type="text" id="email" ></td></tr>
<tr><td>Password </td><td><input type="password" id="pass"></td></tr>
<tr><td></td><td><input type="submit" value="Submit"></td></tr>
</table>
</form>
</html>
Thanks
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.