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

Another member of the list pointed out I'd completely misunderstood your 
last email so apologies for my last reply. I understand what you mean now 
and agree it's needed. My only comment would be that this seems like 
something which would be best housed in the event data for the onsubmit 
event since that's when it would become valid to access it.

--Matt

----- Original Message ----- 
From: "Nikodem" <nikn1@gazeta.pl>
To: <www-dom@w3.org>
Sent: Thursday, October 11, 2007 6:13 PM
Subject: [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 Friday, 12 October 2007 09:42:51 UTC