Forum Moderators: mack

Message Too Old, No Replies

VBScript or ASP link code

         

NotAFanOfPrograming

7:56 pm on Jul 1, 2004 (gmt 0)

10+ Year Member



I have a program that uses VBScripting and within it i have this button, that has an ID, and I want to make it into a hyperlink that will load an ASP page and pass along variables in the URL.

What is the code to do this? I have searched everywhere and have found nothing remotely close to makeing a hyperlink out of a button with an ID name.

Thanks

MrsD

8:41 pm on Jul 1, 2004 (gmt 0)



Hello....
you can try this.. I am also new at programming and i have a site that passes a record from the record id from a text link to an asp page....

<a href="int_emp_edit.asp?recordId=<%=(intUser.Fields.Item("recordID").Value)%>">
Edit this record</a>

see if you can edit this link to work for you.

hope this helped!

Krapulator

4:26 am on Jul 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's because a button isn't a hyperlink.

You can use client side javascript on the button:

<input type="button" value="Submit" id="whatever" onclick="window.location.href=('linkedpage.asp?var1=<%=var1%>&var2=<%=var2%>');">

or you could use a form to pass the variables (this is a better method because it does not require Javascript to work).

<form name="whatever" method="post" action="linkedpage.asp">
<input type="hidden" name="var1" id="var1" value="<%=var1%>">
<input type="hidden" name="var2" id="var2" value="<%=var2%>">
<input type= "submit" name="button" value="submit">

</form>