Click to See Complete Forum and Search --> : Submit with hyperlinks?
joey o.
Nov 6th, 2000, 10:11 AM
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.
Serge
Nov 6th, 2000, 11:37 AM
You will need to construct your query string within your hyperlink.
Serge
Nov 6th, 2000, 11:51 AM
Or better yet you can do something like this:
<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>
joey o.
Nov 6th, 2000, 01:26 PM
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?
Serge
Nov 6th, 2000, 01:43 PM
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???
joey o.
Nov 6th, 2000, 02:12 PM
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.
Serge
Nov 6th, 2000, 02:36 PM
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:
<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,
joey o.
Nov 6th, 2000, 02:47 PM
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.
Serge
Nov 6th, 2000, 02:56 PM
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.
jesus4u
Nov 28th, 2001, 07:48 AM
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:
<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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.