Results 1 to 10 of 10

Thread: Submit with hyperlinks?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    Hi,
    I'm using VBScript. I've got a bunch of hyperlinks and I want to pass all the info in the form whenever I click one. I don't want to list all the available info on the page seperately. I want my hyperlink to do what Submit does. How do I make this happen? I'm using VBScript.
    Thanks,
    Joey O.

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    You will need to construct your query string within your hyperlink.

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Or better yet you can do something like this:
    Code:
    <HTML>
    <SCRIPT Language=VBScript>
    Sub SubmitInfo
    	frmMyForm.submit
    End Sub
    </SCRIPT>
    </BODY>
    
    <FORM action="MyASPPage.asp" name=frmMyForm id=frmMyForm>
    UserName:<INPUT Type=Text name=txtName><BR>
    Password:<INPUT Type=Text name=txtPassword><BR>
    
    <BR>
    <U><P onclick="VBScript: SubmitInfo" style="cursor=hand">Submit</P></U>
    
    </FORM>
    
    </BODY>

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    This will work for me only if I can do a select or "if" on: <FORM action="MyASPPage.asp" name=frmMyForm id=frmMyForm> Is this possible?

  5. #5
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Are you saying that you don't have a FORM tag at all and you need to send the values over to the next page???

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485
    No, I do have form tags but if I use
    <FORM action="MyASPPage.asp" ...> then how do I use this on my other links so that they go to "MyOtherASPPages.asp"?

    I need a way to go to any link on one page with any href and have it bring the info as if it were a submit button with it instead of using QueryString.

  7. #7
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Then you would need to do something like this. Don't specify the Action attribute in the FORM tag, but rather pass it into the function:
    Code:
    <HTML>
    <SCRIPT Language=VBScript>
    Sub SubmitInfo(p_strPageURL)
    	frmMyForm.action = p_strPageURL
    	frmMyForm.submit
    End Sub
    </SCRIPT>
    </BODY>
    
    <FORM name=frmMyForm id=frmMyForm Method=Post>
    UserName:<INPUT Type=Text name=txtName><BR>
    Password:<INPUT Type=Text name=txtPassword><BR>
    
    <BR>
    <U><P onclick="VBScript: SubmitInfo(YourPageName.asp)" style="cursor=hand">Submit</P></U>
    
    </FORM>
    
    </BODY>
    Basically, all you'll have to do is to pass the URL where the page should submit to and it will port the data over.


    Regards,

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    YEEEEEEEEEEE!

    FINALLY IT ALL WORKS!!!!
    CAN'T THANK YOU ENOUGH!

    Serge,
    Although unrelated to this forum, do you ever host chat seminars or live Q&A's on your site? If so please let me know.

  9. #9
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    I think the CHAT will do the job. But at this point we need people that actualy can be there. If we can setup a certain time for it, then we can do anyting you guys want.

  10. #10
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216
    Originally posted by Serge
    Then you would need to do something like this. Don't specify the Action attribute in the FORM tag, but rather pass it into the function:
    Code:
    <HTML>
    <SCRIPT Language=VBScript>
    Sub SubmitInfo(p_strPageURL)
    	frmMyForm.action = p_strPageURL
    	frmMyForm.submit
    End Sub
    </SCRIPT>
    </BODY>
    
    <FORM name=frmMyForm id=frmMyForm Method=Post>
    UserName:<INPUT Type=Text name=txtName><BR>
    Password:<INPUT Type=Text name=txtPassword><BR>
    
    <BR>
    <U><P onclick="VBScript: SubmitInfo(YourPageName.asp)" style="cursor=hand">Submit</P></U>
    
    </FORM>
    
    </BODY>
    Basically, all you'll have to do is to pass the URL where the page should submit to and it will port the data over.

    Regards,

    I like this code example ALOT! VERY good!

    I need a modification though. Do you have any ideas as to how to redirect the user to another page after they submit the form to the same page?

    I am using the exact same scenario as joey o.
    thanks

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