cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Bug in forms-lib.js when adding @id to submit buttons?
Date Wed, 03 Nov 2004 17:49:35 GMT
Joerg Heinicke wrote:

> On 03.11.2004 11:56, Sylvain Wallez wrote:
>
>> The problem is not in CForms, but in HTML: each form element (input, 
>> button, etc) is added as a property of the form it belongs to. 
>> Problem is that these new properties hide those that may already 
>> exist with the same name on the form.
>>
>> And a form already has a "submit" property which is a function, which 
>> means that if you have an <input name="submit">, we can no more 
>> programmatically submit the form using "form.submit()"...
>
>
> Indeed a nice one ...
>
>> So the solution is to avoid naming CForms widget "submit"... Maybe we 
>> could enforce this at the form definition parsing level?
>
>
> Hmm, I would not do it. On the one hand you can not check the code 
> added in the templates as Bart did it. On the other hand form has more 
> properties though submit is probably the most used one. What about a 
> property 'action'? It would also break the form.


Don't know, as "action" is an attribute.

> It's a problem of HTML, so we should not fix it in CForms IMO. 
> Otherwise it will be a never ending story. It's a 'feature' that 
> should made it into the FAQ.


Ok for the FAQ, but if several people fall into that trap, we may add 
some checks into the HMTL styling part of CForms for some well-known 
cases like "submit".

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message