Hello I'm trying to do two fold with this script.
1. Add a additional promotion code that links to a 2nd .html location. Else goes to a 3rd location.
2. Verify the two promotional codes are correct or incorrect with Alert function via the check it button.
Script below. Any help would be appreciated!
1. Add a additional promotion code that links to a 2nd .html location. Else goes to a 3rd location.
2. Verify the two promotional codes are correct or incorrect with Alert function via the check it button.
Script below. Any help would be appreciated!
Code:
<html>
<head>
<script type="text/javascript">
<!--
function checkThis(){
var val = document.getElementById('myText').value;
var myForm = document.getElementById('myForm');
if(val=="promocode1")
myForm.action="url1.html";
else
myForm.action="url2.html";
}
//-->
</script>
</head>
<body>
<form id="myForm" name="myForm" method="post" onsubmit="checkThis()">
<p>
<input type="text" id="myText" name="myText" />
<input name="button" type="button" value="Check It"/>
</p>
<p>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</p>
</form>
</body>
</html>