Quantcast

submitting forms with Enter key

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

submitting forms with Enter key

Brad Clarke
I need to add something to simulate submitting forms by hitting Enter inside of form
fields. Getting the form and just calling submit() doesn't work because that
simulates calling a javascript form.submit() which skips the onsubmit handler.

I've come up with various ideas that all suck for one reason or another so I thought
I'd ask around a bit for ideas. Anyone?

Brad C




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: submitting forms with Enter key

Marc Guillemot
Performing a quick test:
- on Firefox: it seems that a hit on Enter is equivalent to clicking on
the first submit button of the form
- on IE: no submit button is "clicked" but the form's onsubmit is called
which would require some adaptatation in Form.submit(SubmittableElement)
  to call the onsubmit handler when the SubmittableElement is null.

Marc.


Brad Clarke wrote:

> I need to add something to simulate submitting forms by hitting Enter inside of form
> fields. Getting the form and just calling submit() doesn't work because that
> simulates calling a javascript form.submit() which skips the onsubmit handler.
>
> I've come up with various ideas that all suck for one reason or another so I thought
> I'd ask around a bit for ideas. Anyone?
>
> Brad C
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> HtmlUnit-develop mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
>



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Loading...