[Javascript] Prototype: events on buttons

Michael Borchers list at tridemail.de
Mon Jan 7 03:24:13 CST 2008


I noticed a strange behaviour in Prototype.
I simply call a function, f.e. with an simple AJAX Request, named request():
The file's name is my_file.php.

<input type="button" name="butt1" value="request me" onclick="javascript:request();">
<input type="button" name="butt2" value="request me" onclick="request();">
<a href="javascript:request();">No button</a>

When using the link, the function works fine and Firebug shows me the correct URL of the calles AJAX script,
f.e.: http::www.mydomain.com/test/my_ajax.php

But when clicking the button, the called URL is http::www.mydomain.com/test/my_file.php and nothing happens.

It only appears when working with Prototype, it works fine with normal HTML/JS.

Is this a prototype bug or feature for input buttons?

-- 
MfG
Michael Borchers
Tridem GmbH
http://www.tridem.de
mailto: borchers at tridem.de
Tel.: 0491 / 96 06 71 63
ICQ: 322766923
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20080107/4080fef4/attachment.htm>


More information about the Javascript mailing list