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

    Append input field to href link

    I have this link

    "http://hits/SearchResult.asp?SearchParam=OwnerID&SearchValue="

    I have an input field called "txtcustnam" ...

    I would like to be able to append "txtcustnam" to the end of the link.

    I have tried this <a class=links href="http://hits/SearchResult.asp?SearchParam=OwnerID&SearchValue=" + "document.getElementById('txtcusnam').value" target="_blank">Computer Search</a></TD>

    and it doesn't seem to work

    I have search google and other sites, and can't seem to find anything that will work.

    Anyone have any brilliant Ideas?

  2. #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    4,595
    Thanks
    14
    Thanked 480 Times in 475 Posts
    that’s because of the quotes. in the browser your link would be parsed as

    <a class=links href="http://hits/SearchResult.asp?SearchParam=OwnerID&SearchValue=" target="_blank">Computer Search</a>

    additionally, your JavaScript would have been seen as plain text.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  3. #3
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, that is what it is doing. As I said, what i posted doesn't work. So, if that is the case. is there something that WILL work?

  4. #4
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this is what i have come up with thus far ... and ... not working

    Online Javascript Editor


 

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
  •