Results 1 to 7 of 7

Thread: passing values to a hyperlink

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    145

    passing values to a hyperlink

    Hi,

    I have a textbox and a hyperlink on the same page. Is it possible to pass the value of the textbox control as parameter to the hyperlink?

    thanks.

  2. #2
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    How do you mean? When the text box is changed? You could do something like this I suppose:

    Code:
    <input name="textboxName" value="Blah..."
     onchange="document.links['linkId'].href = 'page.php?value='+this.value;" />
    <a href="page.php" id="linkId">Link</a>
    I think that should work.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    145
    I'd like to pass the value of the textbox as parameter to the hyperlink. So when the user input a value in the textbox, say "Marivic" then when the user clicks on the hyperlink, it should have "Marivic" as parameter, something like:

    href="myasp.asp?name=textbox1.value"

    where textbox1.value="Marivic"


    Thanks.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    145
    I'd like to pass the value of the textbox as parameter to the hyperlink. So when the user input a value in the textbox, say "Marivic" then when the user clicks on the hyperlink, it should have "Marivic" as parameter, something like:

    href="myasp.asp?name=textbox1.value"

    where textbox1.value="Marivic"


    Thanks.

  5. #5
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    Code:
    <a href="#" onclick="window.location='http://www.somesite.com/page.php?value='+textbox1.value;">Click Me</a>
    Something like that?

  6. #6
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    The code I gave you in the first place should have done what you wanted

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Oct 2002
    Posts
    145

    Resolved

    Yup..that did it!

    Thanks for helping guys.

Posting Permissions

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



Click Here to Expand Forum to Full Width