I have a hidden input area within a form on a page:
<form id="contactForm" method="post" action="../scripts/sendmail_cdo.asp" style="background:#E6E7E8; padding:10px;">
<div id="emailDiv">
<input type="text" name="email" autocomplete="off" value="">
</div>
</form>
On the page the form is submitted to, at the very top of the page I have my script, to check if the input has a value or not, just testing both to try and get it to work, and it doesnt seem to recognise my code, basically its not re-directing to any of the pages below
<script>
var val = document.getElementById('email').value;
if (/^\\s*$/.test(val)){
self.location="[contact/index1.asp](http://www.hobbsvalve.co.uk/contact/index1.asp)";
} else {
self.location="[contact/index2.asp](http://www.hobbsvalve.co.uk/contact/index2.asp)";
}
</script>
Not sure what Im doing wrong.
Cheers