cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: [2.1.8-dev] No widget should be named'submit' [was: Problems in CForms in latest from SVN]
Date Wed, 21 Sep 2005 15:14:43 GMT
Sylvain Wallez wrote:
> 
> This has been added to 2.2 some months ago. Basically, the big problem 
> with inputs named "submit" is that they hide the submit() function on 
> the Form object in the browser document.
> 
> This isn't really a problem until you have some event handlers on an 
> input, that needs to programmatically call form.submit(). In that case, 
> the form is not submited and there's an JS error in the browser such as 
> "object is not a function".
> 
> I spent many hours finding such problems, and many CForms users already 
> encountered it (see for example [1]). Hence this decision to forbid 
> widgets named "submit".
> 
> So what should we do: allow widgets named "submit" knowing that it will 
> break forms with event handlers, or allow it for the sake of 
> compatibility, letting users pull their hairs with weird broken forms?
> 
Ok, I pulled my hair out because yesterday my form worked and today not
:) - Now, I think the real problem is that the error was nowhere to be
seen, so I had to debug to find this out. Perhaps this is related to the
problems with logging exceptions as discussed in the other thread. If
not, we really should present a meaningful exception.
IllegalArgumentException didn't help me.

So, let's leave it as it is but provide a better exception.

Carsten

-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Mime
View raw message