• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

selecting a radio button for IE & Netscape

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do you set the selection of the radio button that work both for IE and Netscape.
<form name="forname" action="any.do">
<input type="radio" name="obj" id="objID" value="0"></html:radio >
<input type="radio" name="obj" id="objID" value="1"></html:radio >
<input type="radio" name="obj" id="objID" value="2"></html:radio >
</form >

scenario: current selected radio is 0, i want to change the selection to 2 "changeRadio(2)"
thanks
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the HTML or under Javascript control? And what version of Netscape? The answers you'll get will vary greatly with these answers.
bear
 
ritchie diputado
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Under javascript control. I want this to be as much as posible cross browser.
thanks
 
Bear Bibeault
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The reference document.formname.obj will reference the radio group. This is a collection of the radio buttons.
So the following:

will set the second radio button as the selected button. (Note that this is an array index and has nothing to do with the values of the buttons).
hth,
bear
P.S. I know that this will work in all modern browsers.
[ September 23, 2003: Message edited by: Bear Bibeault ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic