25 users online (0 members and 25 guests)  


  Results 1 to 2 of 2

Related

  1. open url from text box? pls help    Forum: Javascript Forum
    Replies: 69
  2. Replies: 0
  3. how to open save/open dialog using HTML    Forum: HTML Forum
    Replies: 1
  4. open url from text box    Forum: Javascript Forum
    Replies: 5
  1. #1
    sqirl69's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2009
    Posts
    1

    open url from text box

    so, im managing a bunch of servers and im looking for a simple script that has the following... Text box, and a go button.

    the url im trying to create is the same for several thousand servers with the exception of the server name.

    So what im hoping to do is have the text box be where i put the server name, and the go button built out the url and open a new window to it.

    The url is like this (and will always be like this).... https://servername-oob

    Ive seen a few other examples for this for other things but just couldnt get my head around how to modify them for this purpose.

    it doesnt need to be fancy, doesnt need any error checking... just the text box, open button, and open into a new page. all thats needed.

    Anybody able to help?

    Thanks
    Paul

  2. #2
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: open url from text box

    Here you go:

    Code:
    <script type='text/javascript'>
            function gotoserver() {
                    sn = document.getElementById('server').value;
                    redirecturl = 'https://'+sn;
                    document.location.href=redirecturl;
            }
    </script>
    
    <input type='text' name='server' id='server' />
    <input type='button' value='Go' onclick='javascript:gotoserver();' />



Tags for this Thread