By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,480 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,480 IT Pros & Developers. It's quick & easy.

javascript submit button

P: n/a
hi all...
is there a way to call a backend application on the onclick event of a
submit button?....
thank you....
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In article <52**************************@posting.google.com >,
ar************@yahoo.com enlightened us with...
hi all...
is there a way to call a backend application on the onclick event of a
submit button?....
thank you....


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?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2

P: n/a
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!
Jul 20 '05 #3

P: n/a
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
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.