javascript submit button

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • arpita

    javascript submit button

    hi all...
    is there a way to call a backend application on the onclick event of a
    submit button?....
    thank you....
  • kaeli

    #2
    Re: javascript submit button

    In article <52d58317.03121 90224.1dbe735b@ posting.google. com>,
    arpitabahuguna@ yahoo.com enlightened us with...[color=blue]
    > hi all...
    > is there a way to call a backend application on the onclick event of a
    > submit button?....
    > thank you....
    >[/color]

    In .NET, yeah, with postback, but I don't know about other
    appplications. Mostly client-side script is limited to the client, so
    you'd either have to open a new window and call a cgi or server-side
    script or use ActiveX or COM.

    --
    --
    ~kaeli~
    If it's tourist season, why can't we shoot them?



    Comment

    • arpita bahuguna

      #3
      Re: javascript submit button

      hey....
      thanx a lot for the reply...
      but i basically didnt want it in .net....
      but anyways i have found the solution to my problem....
      basically i had to call a backend cgi program and pass some parameters
      to it too....
      so on the onclick event of the button i had to call another javascript
      function first that would assign values to hidden input types, which
      would then be passed onto the other cgi program...
      thanx a lot anyways...



      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Grant Wagner

        #4
        Re: javascript submit button

        arpita wrote:
        [color=blue]
        > hi all...
        > is there a way to call a backend application on the onclick event of a
        > submit button?....
        > thank you....[/color]

        If client-side scripting is enabled, and the DOM of the UA supports the
        Image() object, sure:

        <input type="button" onclick="(new Image()).src =
        '/cgi-bin/something.cgi'; ">

        something.cgi would start the process on the server.

        Note that while you could obtain information about what happened when
        something.cgi ran, it's a bit tricky and involves something.cgi actually
        returning content of type image/gif with valid content.

        If you absolutely need to know what happened, and can live with IE and
        Mozilla support only, you could use the HTTPRequest object to fire off
        something.cgi: <url: http://jibbering.com/2002/4/httprequest.html />

        Lastly, you can actually do the same sort of thing without client-side
        JavaScript enabled at all:

        <form method="get" action="/cgi-bin/something.cgi">
        <input type="submit" value="Click here to run something.cgi">
        </form>

        In all examples, something.cgi is something the server can execute to
        start your process (it could be C, Perl, PHP, server-side JavaScript, ASP,
        JSP, ColdFusion, etc) As long as it can get to the underlying OS on the
        Web server to request that something be started either there, or on
        another host (using remsh for example), it will work.

        Be aware of security concerns, with all examples, anyone who knew
        /cgi-bin/something.cgi existed on your server, and it wasn't protected in
        any way, could fire it automatically and repeatedly, perhaps having fatal
        consequences for your server.

        --
        | Grant Wagner <gwagner@agrico reunited.com>

        * Client-side Javascript and Netscape 4 DOM Reference available at:
        *


        * Internet Explorer DOM Reference available at:
        *
        Gain technical skills through documentation and training, earn certifications and connect with the community


        * Netscape 6/7 DOM Reference available at:
        * http://www.mozilla.org/docs/dom/domref/
        * Tips for upgrading JavaScript for Netscape 7 / Mozilla
        * http://www.mozilla.org/docs/web-deve...upgrade_2.html


        Comment

        Working...