<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<form action="#" method="post" οnsubmit="return relidate()">
<input type="text" id="aa"/>
<input type="submit"/>
</form>
</body>
<script>
function relidate()
{
var str = document.getElementById("aa").value;
var reg=/^[a-z]*$/;
alert(reg.test(str));
if(reg.test(str))
{
alert("√");
return true;
}
else
{
return false;
alert("×");
}
}
</script>
</html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<form action="#" method="post" οnsubmit="return relidate()">
<input type="text" id="aa"/>
<input type="submit"/>
</form>
</body>
<script>
function relidate()
{
var str = document.getElementById("aa").value;
var reg=/^[a-z]*$/;
alert(reg.test(str));
if(reg.test(str))
{
alert("√");
return true;
}
else
{
return false;
alert("×");
}
}
</script>
</html>