Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Quick Form Question

Options
  • 21-04-2008 5:06pm
    #1
    Registered Users Posts: 1,096 ✭✭✭


    This could be a stupid question, but any help is much appreciated.

    Is there any type of a form/script where a person can type in a number, lets say 1234, and be brought to http://www.website.ie/1234 etc? I know you can do it with a java drop down menu, but I need to do it via a text field.

    Any ideas?


Comments

  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    EI-DAV wrote: »
    This could be a stupid question, but any help is much appreciated.

    Is there any type of a form/script where a person can type in a number, lets say 1234, and be brought to http://www.website.ie/1234 etc? I know you can do it with a java drop down menu, but I need to do it via a text field.

    Any ideas?

    Is this through JavaScript?

    [html]
    <script type="text/JavaScript">
    function doURL()
    {
    var sURL = document.getElementById("txtURL").value;
    if (sURL != "")
    {
    document.location.href= "http:\/\/www.website.com\/" + sURL;
    }
    }
    </script>
    ...
    <input type="text" id="txtURL" value=""/>
    <input type="button" onclick="doURL()" value="go"/>
    [/html]


  • Registered Users Posts: 1,096 ✭✭✭ImDave


    Thats exactly what I was looking for, couldnt find it anywhere myself - thanks alot! :)


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    No probs :)


Advertisement