-
Nov 6th, 2000, 11:11 AM
#1
Thread Starter
Hyperactive Member
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.
-
Nov 6th, 2000, 12:37 PM
#2
You will need to construct your query string within your hyperlink.
-
Nov 6th, 2000, 12:51 PM
#3
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>
-
Nov 6th, 2000, 02:26 PM
#4
Thread Starter
Hyperactive Member
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?
-
Nov 6th, 2000, 02:43 PM
#5
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???
-
Nov 6th, 2000, 03:12 PM
#6
Thread Starter
Hyperactive Member
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.
-
Nov 6th, 2000, 03:36 PM
#7
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,
-
Nov 6th, 2000, 03:47 PM
#8
Thread Starter
Hyperactive Member
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.
-
Nov 6th, 2000, 03:56 PM
#9
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.
-
Nov 28th, 2001, 08:48 AM
#10
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|