HTML Text box to add to URL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jlucht01
    New Member
    • May 2010
    • 2

    #1

    HTML Text box to add to URL

    I do alot with tinyurl.com and I want to make a page that I can just put the last part into and hit go. I need a text box with a button that will add whatever is typed into the box to the end of http:\\www.tiny url.com\. I am not sure how to concatenate in html or if its even possible.

    Thanks
    Joe
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    It's definitely possible, though not solely with HTML. I'll move this thread over to JavaScript, and those guys will point you in the right direction.

    Comment

    • jlucht01
      New Member
      • May 2010
      • 2

      #3
      Had a thought... edited post

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        jlucht01, please don't make a full post and then edit it. It's slightly confusing.

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          As simple as
          Code:
          var url = "http://www.tinyurl.com/" + val;
          where val is the value from the text box. Then you can use url to redirect to a new page or whatever. I suppose this could be done server-side too if the form is submitted and the input appended to the URL.

          PS. URLs are forward-slash, not backslash.

          Comment

          Working...