Re: [pear-webmaster] JavaScript bug at package-maintainers.php
| From: | Martin Jansen | Date: | Tue, 19 Aug 2003 13:09:32 +0000 |
| Subject: | Re: [pear-webmaster] JavaScript bug at package-maintainers.php | ||
| References: | 1 | Groups: | php.pear.webmaster |
| Request: | Send a blank email to pear-webmaster+get-453@lists.php.net to get a copy of this message | ||
On Mon Aug 18, 2003 at 07:1244PM +0200, Christian Wenz wrote:
> Here is the XHTML code for the "Add as" button:
>
> <input type="submit" onClick="javascript:addMaintainer(); return false"
> name="add" value="Add as" />
>
> however, after onClick just plain JavaScript code is expected by
> browsers, using the pseudo protocol "javascript:" (which is only used in
> URLs) is IMO just wrong. Mozilla seems to ignore that, but other
> browsers just dislike this onClick event handler and directly submit the
> form, therefore not adding a maintainer.
>
> Resolution: remove "javascript:":
>
> <input type="submit" onClick="javascript:addMaintainer(); return false"
> name="add" value="Add as" />
Thanks, I didn't know that IE has problems with that.
> Note: Instead of <input type="submit" ... />, IMO <input
> type="button"
> ... /> should be used
I'm not sure if that's supported by all browser, thus I'll leave it as
it is.
> Another note: "javascript:" is also incorrectly used elsewhere in
> package-maintainers.php, e.g. in the <form> tag.
I've dropped all of them.
--
- Martin Martin Jansen
http://martinjansen.com/