Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JS/JQ get unique url from data input.

    i need something that does the following:
    single text field with button. u can input a name then click button. and it redirects or brings a pop up of
    http:***.***.***/***/***/YOUR TEXT/***/**.**
    The url is constant apart from the variable in the middle.

    THIS IDEALLY MUST BE SOMTHING SELF CONTAINED I CAN JUST PASTE IN TO PAGE SOURCE HTML.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    3,763
    Thanks
    23
    Thanked 548 Times in 547 Posts
    Code:
    <body>
    Enter word: <input type="text" id="magic" />
    <button onclick="goto("magic");" value="PUSH">PUSH</button>
    
    <script type="text/javascript">
    function goto(TEXT){
    	window.location.href = 'http:***.***.***/***/***/'+TEXT+'/***/**.**';
    }
    </script>
    </body>
    Or you could use inline JS instead of a function
    Evolution - The non-random survival of random variants.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •