/////////////////////////////////////////Just Copy Past///////////////////////////////
<form name= "reg" id="reg" method="POST" action="http://www.qualityzoneinfotech.com/" onsubmit="return validate()">
<input id="first" name="first" type="text" value="" placeholder="first"><br />
<input id="email" name="email" type="text" value="" placeholder="email"><br />
<textarea id="message" name="message" placeholder="message" ></textarea><br />
<input type="submit"></button>
</form>
<script type="text/javascript">
function validate(){
var formIsValid = true;
var first=document.forms["reg"]["first"];
if(first.value == null || first.value == ""){
first.style.borderColor = "red";
formIsValid = false;
}
var email=document.forms["reg"]["email"];
if(email.value == null || email.value == ""){
email.style.borderColor = "red";
formIsValid = false;
}
var message=document.forms["reg"]["message"];
if(message.value == null || message.value == ""){
message.style.borderColor = "red";
formIsValid = false;
}
return formIsValid;
}
</script>
<form name= "reg" id="reg" method="POST" action="http://www.qualityzoneinfotech.com/" onsubmit="return validate()">
<input id="first" name="first" type="text" value="" placeholder="first"><br />
<input id="email" name="email" type="text" value="" placeholder="email"><br />
<textarea id="message" name="message" placeholder="message" ></textarea><br />
<input type="submit"></button>
</form>
<script type="text/javascript">
function validate(){
var formIsValid = true;
var first=document.forms["reg"]["first"];
if(first.value == null || first.value == ""){
first.style.borderColor = "red";
formIsValid = false;
}
var email=document.forms["reg"]["email"];
if(email.value == null || email.value == ""){
email.style.borderColor = "red";
formIsValid = false;
}
var message=document.forms["reg"]["message"];
if(message.value == null || message.value == ""){
message.style.borderColor = "red";
formIsValid = false;
}
return formIsValid;
}
</script>
No comments:
Post a Comment