Results 1 to 8 of 8

Thread: Passing variable using radio button via hyperlink

  1. #1
    Guest

    Angry

    Hi everyone,
    Need Help

    I know javascript can do it, I already get it. But now I want to using ASP.

    I want to pass a variable using Radio buton via the byperlink, can I do that?
    let say i have 3 radio button like below and I want to know which button I select and pass to asp2.asp page.

    <Input type="radio" name="R1" value="V1">Test1
    <Input type="radio" name="R1" value="V2">Test1
    <Input type="radio" name="R1" value="V3">Test1

    <A href="asp2.asp? ">Next</A>

    At the asp2.asp i using the statement:

    <% R1=request.querystring("R1")%>

    Hope anyone of u can help me ASAP.
    Need a sample code as well.



    Thx in advanced,

    Mac


  2. #2
    Member
    Join Date
    Jun 2000
    Posts
    45
    I am assuming that you have the radio buttons in a form. You set the form method to GET, the action to "asp2.asp", then for your hyperlink make it a submit button (or if you want a picture you just:
    <INPUT type="image" src="pathtoimage">)

  3. #3
    Guest

    Angry Hyperlink

    But how i oing to make the hyperlink like submit button.
    Since my hyperlink just simply a text call "Next"

    the htm code like:

    <A Href="asp2.asp? >Next</A>

    the above code cannot submit the variable right ?
    So how, for image I know can.

    DO response ASAP



    Mac

  4. #4
    Member
    Join Date
    Jun 2000
    Posts
    45
    I don't know if you can have just a text link instead of a submit button. If you don't mind having a button on the page, then you can put a submit button on <INPUT type="submit" value="Next">
    Otherwise, you will have to use VBScript (or JavaScript):
    You get value inside whatever inputs you have by using their name (document.formname.inputname)
    If you want to do it this way then post what input types you have and what their names are (and the name of you form) and I can put something together for you.

  5. #5
    Addicted Member
    Join Date
    May 2000
    Posts
    142

    u can do it

    the only way to make a hyperlink a submit button is the following (you'll have to use javascript):

    Code:
    <a href="asp2.asp" onclick = "foo();">TextSubmit</a>
    and then foo() would have the following line of javascript:
    Code:
    document.form1.submit()
    goodluck!

    dvst8
    Secret to long life:
    Keep breathing as long as possible.

  6. #6
    Member
    Join Date
    Jun 2000
    Posts
    45
    That's a whole lot easier than the way I know how to do it.

  7. #7
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    yeah no kidding!
    i use this all the time now...

    /d8
    Secret to long life:
    Keep breathing as long as possible.

  8. #8
    Guest

    Smile Hyperlink

    Since like there is no way to use hyperlink as a submit button. The only way is using JavaScript.
    Any way, thx to all of u.

    If u find there is the way, do send to me. I'm very appreciate it.




    Mac



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