Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #17051
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2012-11-06 08:19 -0800 |
| Message-ID | <015e6c83-d721-441b-8e07-5393238fe005@googlegroups.com> (permalink) |
| Subject | the right "form" element for ajax |
| From | amado.alves@gmail.com |
A recurring issue I see but could not find a definitive answer. When we send user data via AJAX the attribute "action" of the HTML element "form" is useless and even looks like it can get in the way. Usually we call the send data function right from the "onclick" event of a "button" element, and use the getElement functions to fetch the user input. There's no "action" in the "form". Actually we don't even need the "form" element at all. But per the HTML reference the "form" element is required and its "action" attribute too (or isn't it?) Some browsers accept "input" fields and "button" elements without being enclosed in any "form" element. And accept "form" elements without the "action" attribute. But, strictly, this is illegal, right? So, the issue is: what we do? Rely on the permissive behavior of browsers, or write legal HTML and pray it does not interfere with our ajax? I see the Gmail interface has "form" elements with an empty "action" attribute. Would that be the "best practice"? Thanks.
Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread
the right "form" element for ajax amado.alves@gmail.com - 2012-11-06 08:19 -0800
Re: the right "form" element for ajax Tim Streater <timstreater@greenbee.net> - 2012-11-06 17:08 +0000
Re: the right "form" element for ajax Martin Leese <please@see.Web.for.e-mail.INVALID> - 2012-11-06 11:02 -0700
Re: the right "form" element for ajax amado.alves@gmail.com - 2012-11-06 14:35 -0800
Re: the right "form" element for ajax Tim Streater <timstreater@greenbee.net> - 2012-11-06 22:52 +0000
Re: the right "form" element for ajax RobG <rgqld@iinet.net.au> - 2012-11-06 20:23 -0800
csiph-web