Redirect based on text input case insensitive
<p>new here and completely new to javascript.  </p>

<p>I grabbed this bit of code, off this site I believe, I can't remember where.</p>

<pre><code> &lt;form id='formName' name='formName' onsubmit='redirect();return false;'&gt;
            &lt;input type='text' id='userInput' name='userInput' value=''&gt;
            &lt;input type='submit' name='submit' value='Submit'&gt;
        &lt;/form&gt;

        &lt;script type='text/javascript'&gt;
        function redirect() {
            var input = document.getElementById('userInput').value;
            switch(input) {
                case 'keyword1':
                    window.location.replace('page1.html');
                    break;
                case 'keyword2':
                    window.location.replace('page2.html');
                    break;
                default:
                    window.location.replace('error.html');
                    break;
            }


        }
        &lt;/script&gt;
</code></pre>

<p>as it is now it will only work if someone types 'keyword1' not 'Keyword1' or 'KEYWORD1' etc etc.  I'm sure it's simple to fix this but like I said, I'm new :-p</p>

<p>Thanks.</p>
