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
Please help me, How do I get it to work?Code:<script type='text/javascript'> var urlMap = { 'man' : 'http://some.domain/something', 'woman' : 'http://some.domain/something/else', 'cat' : 'http://whatever.you.want/more/here', 'dog' : 'http://the.last.example/for/now' }; function lookupUrl( choice ) { var url = urlMap[ choice ]; if (url === undefined) throw "Improper input!"; return url; } </script> <form> Letters Only: <input type='text' id='letters'/> <input type='button' onclick="isAlphabet(document.getElementById('letters'), 'Letters Only Please')" value='Check Field' /> </form>



Reply With Quote

Bookmarks