Article View: comp.lang.javascript
Article #236Re: Trouble using the comma character in a form input name
From: Grant Wagner
Date: Thu, 14 Jun 2001 19:40
Date: Thu, 14 Jun 2001 19:40
48 lines
2980 bytes
2980 bytes
Nils Lastein wrote: > "Matt Kruse" <mkruse@netexpress.net> wrote in message > news:3b28fba7$0$23242@wodc7nh0.news.uu.net... > > Nils Lastein <nila@dsr.kvl.dk> wrote: > > > I've got a simple HTML-form. Unfornunately the field names is writting > > using > > > a comma like this: > > > <input type="submit" name="abc,ABC" value=" NEXT "> > > > > This is not a valid input name according to the HTML specifications. So, > you > > can't expect it to work. > > > > Why would you want to .clik() this object, anyway? > > It's a submit button. Just call the form.submit() yourself. > > There are several submit forms... nice huh? > > ie: > <FORM METHOD="GET" ACTION="cuwp_cgi"> > <INPUT name="B_X_TN,QPN1" type=submit value=" Previous "> > <INPUT name="B_X_TN,QPN3" type=submit value=" Next "> > .... > > I want to "fake" a click on the "Next" button? > > Nils <input type="button" value="Fake click on Next" onclick="document.forms[0].elements['B_X_TN,QPN3'].click();"> Works in the following browsers: IE 5.01SP2, Netscape 4.61 and Mozilla 0.9.1+ Mozilla/5.0 (Windows; U; Win95; en-US; rv:0.9.1+) Gecko/20010613 Of course, you just move the onclick event code (document.forms[0].elements['B_X_TN,QPN3'].click();) to wherever you want to fake the clicking of "Next". -- | Grant Wagner <gwagner@ugg.com> * Client-side Javascript and Netscape DOM Reference available at: * http://developer.netscape.com/docs/manuals/javascript.html * Internet Explorer DOM Reference available at: * http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtmlrefs.asp * Tips for upgrading JavaScript for Netscape 6/Mozilla * http://www.mozilla.org/docs/web-developer/upgrade_2.html
Technical Details
Message-ID:
<3B2913B7.F988C36C@ugg.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!news-in.mts.net!news2.mts.net.POSTED!not-for-mailReferences:
<u86W6.2112$VQ4.195152@news010.worldonline.dk> <3b28fba7$0$23242@wodc7nh0.news.uu.net> <Ye7W6.902$hi6.119562@news000.worldonline.dk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb3cb,5db296fc6477bbaf X-Google-Attributes: gidfb3cb,public X-Google-Thread: f749f,5db296fc6477bbaf X-Google-Attributes: gidf749f,public X-Google-ArrivalTime: 2001-06-14 12:36:36 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!news-in.mts.net!news2.mts.net.POSTED!not-for-mail Message-ID: <3B2913B7.F988C36C@ugg.com> From: Grant Wagner <gwagner@ugg.com> X-Mailer: Mozilla 4.61 [en]C-CCK-MCD UGG19991005 (Win95; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.javascript,dk.edb.internet.webdesign.clientside Subject: Re: Trouble using the comma character in a form input name References: <u86W6.2112$VQ4.195152@news010.worldonline.dk> <3b28fba7$0$23242@wodc7nh0.news.uu.net> <Ye7W6.902$hi6.119562@news000.worldonline.dk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 50 Date: Thu, 14 Jun 2001 19:40:34 GMT NNTP-Posting-Host: 165.23.247.50 X-Complaints-To: admin@mts.net X-Trace: news2.mts.net 992547634 165.23.247.50 (Thu, 14 Jun 2001 14:40:34 CDT) NNTP-Posting-Date: Thu, 14 Jun 2001 14:40:34 CDT Organization: MTS Internet