Hi there d-machine,
this will check for 6 or more letters...
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
window.onload=function() {
document.forms[0][1].onclick=function() {
if(document.forms[0][0].value.match(/^[a-zA-Z]{6,}$/)){
alert('the input matches the requirement');
}
else {
alert('the input does not match the requirement');
}
}
}
</script>
</head>
<body>
<form action="#">
<div>
<input type="text">
<input type="button" value="check">
</div>
</form>
</body>
</html>
coothead
Bookmarks