Checking for a Checked Radio Button 
Author Message
 Checking for a Checked Radio Button

Why doesn't this work?

  for i=0 to form.company.length-1
   if form.company[i].checked then
    checked=1
   end if
  next

form.company.length returns the correct number of radio buttons with the
name 'company'

Next, I am trying to verify that one of the buttons has actually been
selected.  This doesn't want to work for me.

Thanks
MS



Sat, 04 Oct 2003 21:33:07 GMT  
 Checking for a Checked Radio Button
[]s are jscript/javascript syntax...

  for i=0 to form.company.length-1
   if form.company(i).checked then
    checked=1
   end if
  next

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--

Quote:

> Why doesn't this work?

>   for i=0 to form.company.length-1
>    if form.company[i].checked then
>     checked=1
>    end if
>   next

> form.company.length returns the correct number of radio buttons with the
> name 'company'

> Next, I am trying to verify that one of the buttons has actually been
> selected.  This doesn't want to work for me.

> Thanks
> MS



Mon, 06 Oct 2003 09:22:05 GMT  
 Checking for a Checked Radio Button
is there a VBScript solution.


Quote:
> []s are jscript/javascript syntax...

>   for i=0 to form.company.length-1
>    if form.company(i).checked then
>     checked=1
>    end if
>   next

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

> Please do not email questions - post them to the newsgroup instead.
> --




- Show quoted text -

Quote:
> > Why doesn't this work?

> >   for i=0 to form.company.length-1
> >    if form.company[i].checked then
> >     checked=1
> >    end if
> >   next

> > form.company.length returns the correct number of radio buttons with the
> > name 'company'

> > Next, I am trying to verify that one of the buttons has actually been
> > selected.  This doesn't want to work for me.

> > Thanks
> > MS



Tue, 07 Oct 2003 20:35:23 GMT  
 Checking for a Checked Radio Button
???

The code I posted *is* client side vbscript - all that's different is that I changed the []s to
()s...

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--

Quote:

> is there a vbscript solution.



> > []s are jscript/javascript syntax...

> >   for i=0 to form.company.length-1
> >    if form.company(i).checked then
> >     checked=1
> >    end if
> >   next

> > --
> > Michael Harris
> > Microsoft.MVP.Scripting
> > --

> > Please do not email questions - post them to the newsgroup instead.
> > --



> > > Why doesn't this work?

> > >   for i=0 to form.company.length-1
> > >    if form.company[i].checked then
> > >     checked=1
> > >    end if
> > >   next

> > > form.company.length returns the correct number of radio buttons with the
> > > name 'company'

> > > Next, I am trying to verify that one of the buttons has actually been
> > > selected.  This doesn't want to work for me.

> > > Thanks
> > > MS



Wed, 08 Oct 2003 03:55:28 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. verify that radio button is checked

2. newbie: click image, make radio button checked.

3. Checking a radio button

4. Triggering checked property in radio buttons

5. IE 3.0 - radio button .checked alternative?

6. radio button checked in IE3.02

7. Capture radio button checked value

8. Seeing which radio button is checked?

9. Problem binding the Checked property of a Radio Button

10. API to make radio button and check boxs read only with out turn gray

11. Making Radio Buttons, check boxes , and Frames Transparent

12. API to make radio button and check boxs read only with out turning gray

 

 
Powered by phpBB® Forum Software