Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onClick event

Status
Not open for further replies.

mbutch

Programmer
Nov 17, 2000
100
US
I'm tryling to use VBScript to determine if a user has acrobat reader installed on IE, which I've figured out no prob. The problem is doing something with that information.

In JavaScript I can call a function and pass arguments to it directly in the anchor tag like so:
<a href=&quot;javascript:checkadobe('#coldfusionvariable#');&quot;>
#coldfusionvariable# being the location of the pdf to go to if te user has acrobat reader installed. A differnt #coldfusionvariable# can be set for each anchor tag dynamically when the application gets records from the database.

I'm not very familiar with VBScript, but the only way I was able to do something similar to that was this:
<a href=&quot;javascript...&quot; name=&quot;install&quot; value=&quot;#coldfusionvariable#&quot;>
<script lang...>
sub install_onClick
code...
end sub
</script>
If that is the only way to do it I would have to create a VBS sub process for every single pdf I had a link to on a page, which could be a lot. Is there a way I could use one function like JavaScript to handle all of them? Any suggestions would be greatly appretiated!

Thanks,

Mike
 
Call it like this (I used an asp variable)

<a id=&quot;check&quot; name=&quot;check&quot; href='VBScript:checkadobe(&quot;<%=stest%>&quot;)' >Click</a>
<script language=vbscript>
function checkadobe(sVar)
msgbox sVar

end function
</script>
 
Great, thank you! This is the syntax I used and it worked great:
<a id=&quot;check&quot; name=&quot;check&quot; href='javascript:check_adobe(&quot;#cfvariable#&quot;); VBScript:checkadobe(&quot;#cfvariable&quot;)'>Click</a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top