[Javascript] Radio Button Value Property Does Not Exist in Netscape 6.1?

Hassan Schroeder hassan at webtuitive.com
Mon Oct 29 08:37:33 CST 2001


gregory.john.toland at census.gov wrote:
> 
> Huh?  Netscape doesn't like
> 
> document.forms["frmProfiles"].txtStep1[]       OR

- understandable, since that's not the name you gave your form :-)

> document.frmProfiles.txtStep1[][01].value
> 
> Is that what you meant?

> > <form enctype="text/plain" id="myForm" method="get"
> >       name="myForm" onSubmit="return true;">
> >    <input checked id="txtStep1" name="txtStep1"
> >           tabindex="1"
> >           title="Tabular Profile" type="radio"
> >           value="Tabular">Tabular</input>
> >    <input id="txtStep1" name="txtStep1"
> >           title="Narrative Profile" type="radio"
> >           value="Narrative">Narrative</input>
> > </form>

No, what I meant is what I originally said:

> change id="txtStep1" to id="txtStep1[]" and it works in NS4,6,IE5 ...

/* test - put this in a page: 

<body>
<form 
	enctype="text/plain" id="myForm" method="get" name="myForm" onSubmit="return true;">
   <input checked id="txtStep1[]" name="txtStep1"
          tabindex="1"
          title="Tabular Profile" type="radio"
          value="Tabular">Tabular</input>
   <input id="txtStep1[]" name="txtStep1"
          title="Narrative Profile" type="radio"
          value="Narrative">Narrative</input>
</form>

<script type="text/javascript">
   alert(document.myForm.txtStep1[1].value);
</script>

</body>

 */

HTH!
-- 
H*
Hassan Schroeder ----------------------------- hassan at webtuitive.com 
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

    -- creating dynamic Web sites and applications since 1994 --



More information about the Javascript mailing list