- From: Nikodem <nikn1@gazeta.pl>
- Date: Thu, 11 Oct 2007 19:13:48 +0200
- 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 UTC