Title: Form input field &gt;&gt; URL value
Last modified: August 20, 2016

---

# Form input field >> URL value

 *  [alexondrums](https://wordpress.org/support/users/alexondrums/)
 * (@alexondrums)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/form-input-field-urlvalue/)
 * I’d like to include on one of my pages, a text input field, that when submitted,
   tells the browser to go to a predefined url + the value from the input text:
 * i.e
 * user enters into input field:
 * myname
 * on submit, browser goes to:
 * [http://www.pre-defined-website.com/myname](http://www.pre-defined-website.com/myname)
 * Any ideas how I can do this? It’s a rudimentary login that someone wants to me
   sort out.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [GRAQ](https://wordpress.org/support/users/graq/)
 * (@graq)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/form-input-field-urlvalue/#post-2106215)
 * How about a little javascript?
 *     ```
       jQuery(document).ready(function($){
        $('#BUTTONID').click(function(){
         document.localtion.href='http://www.mydomain.com/'+$('#FIELDID').val();
        });
       });
       ```
   
 *  Thread Starter [alexondrums](https://wordpress.org/support/users/alexondrums/)
 * (@alexondrums)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/form-input-field-urlvalue/#post-2106221)
 * Excellent, thank you – I’m rusty on this sort of thing so will have to read up
   on how I implement it – in the meantime if anyone can explain, I’ll check back
   soon! Thanks
 *  Thread Starter [alexondrums](https://wordpress.org/support/users/alexondrums/)
 * (@alexondrums)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/form-input-field-urlvalue/#post-2106292)
 * I’ve done a little testing and looking around. I’ve put the above jquery in a
   file, and point my form action at the .js file.
 * When i submit, the broswer just displays the JQuery code on a page. Not sure 
   if this is because I’ve not set up the form / JQuery correcly, or if it’s to 
   do with my XAMPP setup. (doing all this on localhost)
 * In the JQuery, I’ve changed #buttonid to the forms submit button ID value, and#
   fieldid to the forms input field ID. Guessing this is right? I’ve not used Javascript
   for years, and I’m very rusty on forms and server side stuff…
 *  Thread Starter [alexondrums](https://wordpress.org/support/users/alexondrums/)
 * (@alexondrums)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/form-input-field-urlvalue/#post-2106464)
 * Could anyone familiar with this kind of thing lend a hand please? It would be
   great to get this working. Thanks!
 *  Thread Starter [alexondrums](https://wordpress.org/support/users/alexondrums/)
 * (@alexondrums)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/form-input-field-urlvalue/#post-2106466)
 * Got it sorted ended with this:
 *     ```
       <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script>
   
       <script>
       jQuery(document).ready(function($){
        $('#loginform').submit(function(){
         window.location = 'http://www.mydomain.com/'+$('#login').val();
         return false;
        });
       });
       </script>
   
       <form id="loginform">
       <input id="login" type="text">
       <input id="logingo" type="submit" value="Submit" />
       </form>
       ```
   

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Form input field >> URL value’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [alexondrums](https://wordpress.org/support/users/alexondrums/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/form-input-field-urlvalue/#post-2106466)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
