W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2007

[HTML DOM] Proposal of method query() in HTMLFormElement

From: Nikodem <nikn1@gazeta.pl>
Date: Thu, 11 Oct 2007 19:13:48 +0200
Message-ID: <470E59CC.7060904@gazeta.pl>
To: www-dom@w3.org

I've had many problems with AJAX-ing forms that more than one <button 
type="submit">. It can't be handled through onsubmit with 
form.elements[0] etc. without such idiotisms like onclick on every button.

I propose method query() that'd return query string 
(application/x-www-urlencoded).

I.e.:

<form onsubmit="alert(this.query())" action="search.php" method="get">
<input type="text" name="search" />
<button type="submit" name="engine" value="1">Google</button>
<button type="submit" name="engine" value="2">Yahoo!</button>
<button type="submit" name="engine" value="3">AltaVista</button>
</form>

<!-- search=xxx&engine=2 -->

interface HTMLFormElement : HTMLElement {
/* ... */
DOMString query()
/* ... */
}
Received on Thursday, 11 October 2007 17:17:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:58 GMT