javascript - How to create input form with multiple options? -
I am trying to set up a form that allows you to enter a password that is up to a specific URL Provides access.
For example, enter "Facebook", and it takes you to www.facebook.com, "Yahoo", it sends you to www.yahoo.com, "google",. ... you get this. If someone says anything in these words, then it gives an error.
This is what I have done so far:
However, this does not work! Can anyone help me set this up! I really want more than 3 options.
Thank you!
I do not know what works in this particular example (it works, submit buttons On clicking, ENTER is not killing). But if you want to create more than 3 sites, you can make it easier:
& lt; Script & gt; // ... sites = {"google": "http://www.google.com", "facebook": "http://www.facebook.com", "yahoo": "http: // www .yahoo.com "}; Function passcode (form) {if (site [form.id.value]) {window.location = sites [form.id.value]; } And {warnings ("invalid password")}} & lt; / Script & gt;
Comments
Post a Comment