script ASP in an onClick event

Discussion in 'ASP General' started by emulman, Sep 12, 2003.

  1. emulman

    emulman Guest

    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..
    emulman, Sep 12, 2003
    #1
    1. Advertising

  2. emulman

    Chris Barber Guest

    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.


    "William Tasso" <> wrote in message
    news:...
    emulman wrote:
    > 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

    --
    William Tasso - http://WilliamTasso.com
    Chris Barber, Sep 13, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JerryG
    Replies:
    0
    Views:
    417
    JerryG
    Dec 20, 2005
  2. bob
    Replies:
    3
    Views:
    179
  3. Replies:
    2
    Views:
    243
  4. Replies:
    4
    Views:
    168
  5. Replies:
    9
    Views:
    161
Loading...

Share This Page