Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #20448

Re: How can javascript detect a fieldset in an array of elements

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!ecngs!feeder2.ecngs.de!212.27.60.7.MISMATCH!feeder1-1.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail
Content-Type text/plain; charset="UTF-8"
Message-ID <1506321.WIFe3XHvss@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Reply-To Thomas 'PointedEars' Lahn <usenet@PointedEars.de>
Organization PointedEars Software (PES)
Date Wed, 26 Jun 2013 02:39:27 +0200
User-Agent KNode/4.10.4
Content-Transfer-Encoding 8Bit
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Subject Re: How can javascript detect a fieldset in an array of elements
Newsgroups comp.lang.javascript
References <379ks8thdutnrglv34mc63mr95kgbglopo@4ax.com> <2529079.e95EOKG17B@PointedEars.de>
MIME-Version 1.0
Lines 36
NNTP-Posting-Date 26 Jun 2013 02:39:28 CEST
NNTP-Posting-Host 5d2ab748.newsspool4.arcor-online.net
X-Trace DXC=RVR^Ddi1d=4nBOkdL^Lo7>4IUK<Cl32<14Fo<]lROoR18kF<OcfhCO;OSYjad_Smc9DZm8W4\YJN<b@mF9jNikd57a5\<`>]gf>Kc3``coVM82
X-Complaints-To usenet-abuse@arcor.de
Xref csiph.com comp.lang.javascript:20448

Show key headers only | View raw


Thomas 'PointedEars' Lahn wrote:

> The reason of the error is most likely not that there is a “fieldset”
> element, but that there are several controls that have the same name.  For
> example, it is common to put a radiobutton group into a “fieldset”
> element. All radiobuttons of a group must have the same name to be
> dependent on one another.
> 
> In that case,
> 
>   elements[i]
> 
> refers to a NodeList of references to those controls.

But that probably does not apply here.  It applies when you access controls 
by name instead of by index.

> An object implementing the NodeList interface does not have a “type”
> property.  As the property does not exist, accessing it results in
> “undefined”, and “undefined” has no properties.
> 
> You can use the fact above to your advantage to find out whether there is
> a group of same-named controls that need to be processed differently:
> 
>   var control = elements[i];
>   if (typeof control.type == "undefined")
>   {

But the second part of the explanation should apply and this approach should 
work regardless.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How can javascript detect a fieldset in an array of elements bugbuster <barryk_56@comcast.net> - 2013-06-25 19:22 -0400
  Re: How can javascript detect a fieldset in an array of elements Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-26 02:34 +0200
    Re: How can javascript detect a fieldset in an array of elements Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-26 02:39 +0200
    Re: How can javascript detect a fieldset in an array of elements John Harris <niam@jghnorth.org.uk.invalid> - 2013-06-26 16:10 +0100
      Re: How can javascript detect a fieldset in an array of elements Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-26 21:21 +0000
        Re: How can javascript detect a fieldset in an array of elements Andrew Poulos <ap_prog@hotmail.com> - 2013-06-27 08:12 +1000
          Re: How can javascript detect a fieldset in an array of elements Tim Streater <timstreater@greenbee.net> - 2013-06-26 23:21 +0100
            Re: How can javascript detect a fieldset in an array of elements Andrew Poulos <ap_prog@hotmail.com> - 2013-06-27 11:58 +1000
        Re: How can javascript detect a fieldset in an array of elements Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-06-27 00:14 +0200
          Re: How can javascript detect a fieldset in an array of elements Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-27 00:45 +0200
            “javascript”? (was: How can javascript detect a fieldset in an array of elements) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-27 13:36 +0200
              Re: “javascript”? Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-07-29 01:21 +0200
                Re: “javascript”? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-07-30 08:51 +0200
            Re: How can javascript detect a fieldset in an array of elements Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-06-27 14:52 +0200
          Re: How can javascript detect a fieldset in an array of elements "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-06-27 14:04 +0300
            Re: How can javascript detect a fieldset in an array of elements Eric Bednarz <bednarz@fahr-zur-hoelle.org> - 2013-06-27 14:45 +0200
              Re: How can javascript detect a fieldset in an array of elements Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-27 15:11 +0200
        Re: How can javascript detect a fieldset in an array of elements Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-27 00:45 +0200
          “javascript”? (was: How can javascript detect a fieldset in an array of elements) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-27 14:21 +0200
          Re: How can javascript detect a fieldset in an array of elements John Harris <niam@jghnorth.org.uk.invalid> - 2013-06-27 14:31 +0100
            Parlance (was: How can javascript detect a fieldset in an array of elements) Christoph Michael Becker <cmbecker69@arcor.de> - 2013-06-27 16:21 +0200
              Re: Parlance Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-27 20:46 +0200
                Re: Parlance John Harris <niam@jghnorth.org.uk.invalid> - 2013-06-28 14:33 +0100
                Re: Parlance Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 15:54 +0200
                Re: Parlance "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-06-28 17:08 +0300
                Re: Parlance Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 17:05 +0200
                Re: Parlance "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-06-28 18:16 +0300
                Re: Parlance Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 17:56 +0200
                Re: Parlance Tim Streater <timstreater@greenbee.net> - 2013-06-28 17:54 +0100
                Re: Parlance Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-06-28 20:50 +0200
                Re: Parlance Andrew Poulos <ap_prog@hotmail.com> - 2013-06-29 07:18 +1000
                Re: Parlance John Harris <niam@jghnorth.org.uk.invalid> - 2013-06-29 17:17 +0100
              Re: Parlance (was: How can javascript detect a fieldset in an array of elements) John Harris <niam@jghnorth.org.uk.invalid> - 2013-06-28 14:53 +0100
                Re: Parlance Christoph Michael Becker <cmbecker69@arcor.de> - 2013-07-15 00:42 +0200
                Re: Parlance John Harris <niam@jghnorth.org.uk.invalid> - 2013-07-15 16:01 +0100
  Re: How can javascript detect a fieldset in an array of elements "Jukka K. Korpela" <jkorpela@cs.tut.fi> - 2013-06-26 08:55 +0300
  Re: How can javascript detect a fieldset in an array of elements Dr J R Stockton <reply1300@merlyn.demon.co.uk.invalid> - 2013-06-27 21:27 +0100

csiph-web