arpita wrote:
hi all...
is there a way to call a backend application on the onclick event of a
submit button?....
thank you....
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 <gw*****@agricoreunited.com>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp
* 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