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 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need Help Please

    I am trying to create a Box (not a drop down box) on my website that when they input a number and hit go it would take them to a url.

    Example:

    They input "224893" in a box and hit go and that would take them to url: www.whatever.com/memo/224893/wa in a NEW window.

    Meaning that the input is actually part of the url but the visitor never sees that part. I apoligize if this makes no sense. I am only good at the basics and not at scripting. All my learning of scripting is trial and error.

    Thanks in advance!!!!!!!

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    something like this perhaps?
    Code:
    <input type="text" id="urlnumber" name="urlnumber" value="Enter a number here" onfocus="if(this.value='Enter a number here'){this.value=''};">
    <input type="button" value="Go" onclick="window.open('http://www.whatever.com/memo/'+urlnumber.value+'/wa');">
    Last edited by _Aerospace_Eng_; 02-25-2005 at 06:11 AM.

  • #3
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    http://www.codingforums.com/postguide.htm

    Welcome to the forums. Please take some time to read through the rules.

    Your objective can't really be done with HTML or CSS. I'd try some sort of javascript or server-side script. Pick which one you hate the least and then ask a moderator to move this post to the appropriate forum. Please don't double post.

  • #4
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Quote Originally Posted by _Aerospace_Eng_
    something like this perhaps?
    Code:
    <input type="text" id="urlnumber" name="urlnumber" value="Enter a number here" onfocus="if(this.value='Enter a number here'){this.value=''};">
    <input type="button" value="Go" onclick="window.open('http://www.whatever.com/memo/'+urlnumber.value+'/wa');">
    Aerospace_Eng, That is exactly what I was looking for, Thank You, Thank You, Thank You!!!!!

    I apoligize for not posting in the correct forum as I had no idea what format I needed!

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Topic title

    I think Richard was referring more to the subject line: a descriptive subject will usually solicit better reponse and at any rate adds to the thread's value when the forums are searched; a subject like "Create URL from form input" would give a much better idea of the topic at hand then "I need help", which is the underlying motivation for the majority of posts.
    Regards,
    Ronald.
    ronaldvanderwijden.com


  •  

    Posting Permissions

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