Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <style>
- #addr1 {
- color: red;
- }
- #invalid_1 {
- color: red;
- position:absolute;
- top:0px;
- left:380px;
- }
- #invalid_2 {
- color: red;
- position:absolute;
- top:28px;
- left:380px;
- }
- #invalid_3 {
- color: red;
- position:absolute;
- top:47px;
- left:380px;
- }
- #invalid_4 {
- color: red;
- position:absolute;
- top:75px;
- left:380px;
- }
- #invalid_5 {
- color: red;
- position:absolute;
- top:103px;
- left:380px;
- }
- #invalid_6 {
- color: red;
- position:absolute;
- top:131px;
- left:380px;
- }
- #invalid_7 {
- color: red;
- position:absolute;
- top:159px;
- left:380px;
- }
- #invalid_8 {
- color: red;
- position:absolute;
- top:188px;
- left:380px;
- }
- #invalid_9 {
- color: red;
- position:absolute;
- top:216px;
- left:380px;
- }
- #mybtn {
- position:absolute;
- top:250px;
- }
- </style>
- <script>
- var invalid = 0;
- function validateForm() {
- var $1= document.forms["myForm"]["ad1"].value;
- var $2= document.forms["myForm"]["ad2"].value;
- var $3= document.forms["myForm"]["ad3"].value;
- var $4= document.forms["myForm"]["pcode"].value;
- var $5= document.forms["myForm"]["tno"].value;
- var $6= document.forms["myForm"]["ot"].value;
- var $7= document.forms["myForm"]["dt"].value;
- var $8= document.forms["myForm"]["money"].value;
- var $9= document.forms["myForm"]["email"].value.indexOf("@");
- invalid = 0;
- //Address 1
- if ($1 == "") {
- document.getElementById("invalid_1").innerHTML = "Please enter some text.";
- invalid += 1;
- }
- else {
- document.getElementById("invalid_1").innerHTML = "";
- }
- //Address 2
- if ($2 == "") {
- document.getElementById("invalid_2").innerHTML = "Please enter some text.";
- invalid += 1;
- }
- else {
- document.getElementById("invalid_2").innerHTML = "";
- }
- //Address 3
- if ($3 == "") {
- document.getElementById("invalid_3").innerHTML = "Please enter some text.";
- invalid += 1;
- }
- else {
- document.getElementById("invalid_3").innerHTML = "";
- }
- //Postcode
- if ($4 == "") {
- document.getElementById("invalid_4").innerHTML = "Please enter some text.";
- invalid += 1;
- }
- else {
- document.getElementById("invalid_4").innerHTML = "";
- }
- //Telephone
- if ($5 == "") {
- document.getElementById("invalid_5").innerHTML = "Please enter some text.";
- invalid += 1;
- }
- else {
- document.getElementById("invalid_5").innerHTML = "";
- }
- //Order Type
- if ($6 == "") {
- document.getElementById("invalid_6").innerHTML = "Please enter some text.";
- invalid += 1;
- }
- else {
- document.getElementById("invalid_6").innerHTML = "";
- }
- //Delivery Type
- if ($7 == "") {
- document.getElementById("invalid_7").innerHTML = "Please enter some text.";
- invalid += 1;
- }
- else {
- document.getElementById("invalid_7").innerHTML = "";
- }
- //Value
- if ($8 == "") {
- document.getElementById("invalid_8").innerHTML = "Please enter an amount.";
- invalid += 1;
- }
- else {
- document.getElementById("invalid_8").innerHTML = "";
- }
- //Email
- if ($9 == -1) {
- document.getElementById("invalid_9").innerHTML = "Invalid email.";
- invalid += 1;
- }
- else {
- document.getElementById("invalid_9").innerHTML = "";
- }
- //Close
- if (invalid != 0) {
- return false;
- }
- else {
- return true;
- }
- }
- function submitter()
- {
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment