- From: Matt Dockerty <matt@nistrum.co.uk>
- Date: Thu, 11 Oct 2007 23:20:16 +0100
- To: <nikn1@gazeta.pl>, <www-dom@w3.org>
What's up with document.forms[0]["engine"].value? Won't that tell you in JS which button was pressed? <button type="submit">... don't think there's such a thing. Try <input type="submit"> and my example above. The "idiotisisms" could be carried out by your server-side code. Check out arrays. I'm not claiming to fully know what you mean in your post but if my first impressions are right you just need to learn a few more things about code rather than proposing standards. --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 Thursday, 11 October 2007 22:20:44 UTC