I've a set of hyperlinks that represet shares on remote computers (e.g.
\\remote1\c$) displayed in an HTA. What I would like to be able to do
is have the user click on a hyperlink and that share is opened in
Windows Explorer.

Now, I know how to call a vbscript/jscript from a hyperlink with the
onclick event but, how using that sub, do I fetch the text of the
calling hyperlink? Or, even better, is it better to pass the text of
hyperlink to the sub as part of the onclick event?

Cheers

Re: Returning the hyperlink text via onclick event by Michael

Michael
Sat Mar 18 11:27:43 CST 2006

Ginolard wrote:
> I've a set of hyperlinks that represet shares on remote computers
> (e.g. \\remote1\c$) displayed in an HTA. What I would like to be
> able to do is have the user click on a hyperlink and that share is
> opened in Windows Explorer.
>
> Now, I know how to call a vbscript/jscript from a hyperlink with the
> onclick event but, how using that sub, do I fetch the text of the
> calling hyperlink? Or, even better, is it better to pass the text of
> hyperlink to the sub as part of the onclick event?
>
> Cheers

<a href='\\server\share' onclick='vbscript:myfunction(me.href)'>blah</a>


funtion myfunction(share)
myfunction = false 'to cancel default action
'more code to actually run "explorer.exe " & share
end function


--
Michael Harris
Microsoft MVP Scripting