JavaScript bug at package-maintainers.php

From: Date: Mon, 18 Aug 2003 17:12:44 +0000
Subject: JavaScript bug at package-maintainers.php
Groups: php.pear.webmaster 
Request: Send a blank email to pear-webmaster+get-450@lists.php.net to get a copy of this message
Hi, I noticed that adding new maintainers to a package at http://pear.php.net/admin/package-maintainers.php?pid=XXX only works with Mozilla/recent Netscape versions, but not with Netscape 4.x or Internet Explorer. After further investigation, I think I found the reason: 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" /> Note: Instead of <input type="submit" ... />, IMO <input type="button" ... /> should be used Another note: "javascript:" is also incorrectly used elsewhere in package-maintainers.php, e.g. in the <form> tag. If you like that, I could provide a patch for the page (but only at the end of the week, I am "on the road" till then). Best, Christian

« previous php.pear.webmaster (#450) next »