script ASP in an onClick event

E

emulman

i need to insert, in a onClick event of a submit button in a form, a
call to an ASP script, like follows:

<INPUT TYPE="SUBMIT" NAME="btnSend" onClick="<%
A_Function_Or_Sub_in_VBScript %>">

the problem is that teh event triggers only event on the client page,
not on the server..how to solve the problem???

thx to all..
 
C

Chris Barber

I think it's implied that the script is supposed to be on the server?

You need to arrange some form of communication between the client and server
in order to request that the script be run and then be notified when its
completed.
This is generally referred to as 'Remote Scripting' and can be accomplished
in a number of ways none of which are trivial or particularly easy at first:

Form post
Hidden form post
Custom hidden form post with user implemented XML messaging
XMLHTTP request
Remote Scripting applet (as used with Visual Interdev)
ActiveX components
Database calls such as RDS

The one I would suggest is that of:

http://developer.apple.com/internet/javascript/iframe.html

I have taken this one and implemented a queued system with XML messages and
message types. However, I then moved on to XMLHTTP which is by far the
easiest but also the least supported unless you have a dedicated group of IE
platforms to roll out to.

In your case, it may be easiest to just post the form and run the script?

Chris.


emulman said:
i need to insert, in a onClick event of a submit button in a form, a
call to an ASP script, like follows:

<INPUT TYPE="SUBMIT" NAME="btnSend" onClick="<%
A_Function_Or_Sub_in_VBScript %>">

the problem is that teh event triggers only event on the client page,
not on the server..how to solve the problem???

put the script into the called page
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top