myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Vieujot <svieu...@apache.org>
Subject Re: document.form[x].onsubmit in
Date Wed, 16 Mar 2005 01:20:48 GMT
Actualy, it is part or the specs.
Look here :
http://www.w3.org/TR/REC-html40/interact/scripts.html
And here :
http://www.w3.org/TR/REC-html40/interact/scripts.html

If no one objects, I will submit this 1 line patch tomorrow as it fixes
some issues, and I can't find cases where it would do wrong.

Thanks,

Sylvain.

On Tue, 2005-03-15 at 16:24 -0600, Heath Borders wrote:

> Unfortunately, I don't think form.onsubmit() is part of the W3C spec. 
> I would hate to inject non-standard javascript into our code.
> 
> 
> On Tue, 15 Mar 2005 07:06:23 -0400, Sylvain Vieujot <svieujot@apache.org> wrote:
> >  The Javascript spec says that if form.submit is called from javascript,
> > document.onsubmit isn't called.
> >  document.onsubmit is called only when the browser does the submit.
> >  
> >  Look here :
> > http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml
> >  "The browser does not trigger the onsubmit event if you call the submit
> > method programmatically. Therefore, if the form is using the form validator
> > script, call the onsubmit method also to trigger the validation."
> >  
> >  Sylvain.
> > 
> >  
> >  On Tue, 2005-03-15 at 10:27 +0100, Manfred Geiler wrote: 
> >  Hm, Are sure this is not a browser issue? The link actually calls the
> > form.submit() method as I remember. What does the Javascript Spec say about
> > this? Manfred Sylvain Vieujot schrieb: > If an h:commandLink is clicked, any
> > form.onsubmit is skipped. > This can lead to problems like unexpected reset
> > for components relying > on this hook to submit their value (like the
> > htmlEditor). > > So, I would need to had the following code to >
> > HtmlLinkRendererBase.renderJavaScriptAnchorStart > > line 328 : > //
> > onSubmit >
> > onClick.append("if("+jsForm+".onsubmit){"+jsForm+".onsubmit();}"); > > I
> > don't think it would break anything. > Does anybody sees any problem adding
> > this code ? > > Thanks, > > Sylvain. 
> 
> 

Mime
View raw message