ASP is processed on the server. JavaScript is processed by the browser. HTML
is processed by the browser. Since HTML is processed by the browser you have
to use an HTML element to request server-side processing. Generally
speaking, there are only two HTML elements that are used to do so: The form
element with a submit event and the anchor element with a click event.
You want to use a click event. To request a server-side script from the
client (the browser) you need to pass a QueryString to the value of the href
as shown in this example so the server-side script can have some kind of
value to test. Try this example...
<a href="thePage.asp?callFunction=yes>Click to Call ASP Function</a>
When "Click to Call ASP Function" is clicked the href will request
thePage.asp. In thePage.asp you need code to look for a QueryString (that
being the 'test' I refer to). Try the test this way...
if request.querystring("callFunction") then
someFunction( )
else
' do nothing
end if
' some code here if and when function returns
....
Remember. unless other circumstances intervene, when the function is
finished being processed it can and will return control back to the caller
which in this case is the if-then branching logic. There's more to it than
this but this brief explanation should help you out some.
Use Google to find and study more examples.
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL
http://metromilwaukee.com/
URL
http://clintongallagher.metromilwaukee.com/