<html>
<head>
<title> Falidasi angka
</title>
<link rel=stylesheet href="style.css" type="text/css">
</head>
<body>
<script language="JavaScript" type="text/javascript">
function cekuser(a) {
re = /^[A-Za-z]{1,}$/;<!--nama harus berupa huruf,--!>
return re.test(a);
}
function checkForm(b) {
if (!cekuser(b.nama.value)) {
alert("Nama harus berupa HURUF semua......!! ");
b.nama.focus();
return false;
}
alert("selamat bergabung");
return true;
}
</script>
<form name="form" method="post" onSubmit="return checkForm(this)">
<table borderColor="#666666" height="29" cellSpacing="0" cellPadding="6" width="285" border="1" align="center">
<td width="426" bgColor="cyan" height="29" align="center">
<table height="1" cellSpacing="0" cellPadding="0" width="336" border="0">
<tr>
<td class="isi" width="139" height="9" align="left">
<b>Nama Anda :</b>
</td>
<td width="220" height="9" align="left">
<input type ="text" name ="nama" size="25" />
</td>
</tr>
<tr>
<td vAlign="center" width="335" colSpan="2" height="1" align="justify">
<p align="center">
</td>
</tr>
<tr>
<td width="335" colSpan="2" height="1" align="justify">
<p align="center"><font face="Verdana">
<input type="submit" value="SUBMIT" name="Submit">
<input type="reset" value="RESET" name="reset" >
</font>
</td>
</tr>
</table>
</td>
</table>
</form>
</body>
</html>
<head>
<title> Falidasi angka
</title>
<link rel=stylesheet href="style.css" type="text/css">
</head>
<body>
<script language="JavaScript" type="text/javascript">
function cekuser(a) {
re = /^[A-Za-z]{1,}$/;<!--nama harus berupa huruf,--!>
return re.test(a);
}
function checkForm(b) {
if (!cekuser(b.nama.value)) {
alert("Nama harus berupa HURUF semua......!! ");
b.nama.focus();
return false;
}
alert("selamat bergabung");
return true;
}
</script>
<form name="form" method="post" onSubmit="return checkForm(this)">
<table borderColor="#666666" height="29" cellSpacing="0" cellPadding="6" width="285" border="1" align="center">
<td width="426" bgColor="cyan" height="29" align="center">
<table height="1" cellSpacing="0" cellPadding="0" width="336" border="0">
<tr>
<td class="isi" width="139" height="9" align="left">
<b>Nama Anda :</b>
</td>
<td width="220" height="9" align="left">
<input type ="text" name ="nama" size="25" />
</td>
</tr>
<tr>
<td vAlign="center" width="335" colSpan="2" height="1" align="justify">
<p align="center">
</td>
</tr>
<tr>
<td width="335" colSpan="2" height="1" align="justify">
<p align="center"><font face="Verdana">
<input type="submit" value="SUBMIT" name="Submit">
<input type="reset" value="RESET" name="reset" >
</font>
</td>
</tr>
</table>
</td>
</table>
</form>
</body>
</html>
kl dengan spasi gmn?
ReplyDelete