coba.java
function cekSubmit(form)
{
if (form.elements[0].value == "" || form.elements[1].value == "" ||form.elements[2].value == "" || form.elements[3].value == "" ||form.elements[4].value == "" )
{alert("Isi semua data telebih dahulu");
} else {
alert("terima kasih " );
}
return(true);
}
sign up . html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Sign Up Session</title>
<script language="JavaScript"type="text/javascript" src="coba.js"></script>
</head>
<body>
<h2>::Sign Up Form::</h2>
<form name="calc" action="#">
Nama :
<br>
<input type="text" size="25" name="input1">
<br>
Email:
<br>
<input type="text" size="25" name="input2">
<br>
Alamat:
<br>
<input type="text" size="25" name="input3">
<br>
Kota:
<br>
<input type="text" size="25" name="input4">
<br>
Kode Pos:
<br>
<input type="text" size="25" name="input5">
<br><br>
<input type="submit" value="Process" onClick = "cekSubmit(this.form)"><br>
</form>
</body>
</html>
Hasil