How do I get the function below to automatically take visitors to different URLs if the value they enter matches man or woman. E.g. If it matches man, it takes them to URL A while woman takes them to URL B
<script type='text/javascript'>
function isAlphabet(elem, helperMsg){
var alphaExp = /man/;/woman/;
if(elem.value.match(alphaExp)){
return true;
}else{
alert(helperMsg);
elem.focus();
return false;
}
}
</script>
<form>
Letters Only: <input type='text' id='letters'/>
<input type='button'
onclick="isAlphabet(document.getElementById('letters'), 'Letters Only Please')"
value='Check Field' />
</form>
After some research and questions here i did is as shown below and it works