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

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 UTC