Hello,
Here is an example:
yourpage.html
Code:
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/jquery-ui.min.js"></script>
<script type="text/javascript">
//<=!=[=C=D=A=T=A=[
function checkform(theForm) {
var d=0;
if ($("#firstname").val() == "") {
d=d+1;
}
if ($("#lastname").val() == "") {
d=d+1;
}
if ($("#email").val() == "") {
d=d+1;
}
if (d > 0) {
alert("Please complete all fields!");
return false;
}
theForm.submit();
return false;
}
//]=]=>
</script>
</head>
<body>
<form id="test" action="page.php" onsubmit="checkform(this); return false;" method="POST" >
<input type="text" name="firstname" id="firstname" placeholder="First name*"><br/>
<input type="text" name="lastname" id="lastname" placeholder="Last name*"><br/>
<input type="text" name="email" id="email" placeholder="Email*"><br/>
<input type="submit" name="submit" id="submit" value="Subscribe">
</form>
</body>
</html>
You have to customize it in CSS , this is just the basic code.
Also do you need the .php page which inserts subscriptions into database ?