If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Javascript: select first value in Radio button group

Started by venkiatmaruthi, 16 Mar 2011 08:15:31 AM

Previous topic - Next topic

venkiatmaruthi

How to select first value in a radio button group using Javascript.

say I have a radio button group for Country.

Canada
Englad
SouthAfrica
India
Pakistan
Japan
China

I want every time the Englad should select.


<script>
var radbut=document.getFormWarpRequest()._oLstChoicesLocation;
radbut.options[1].checked=true;
</script>

melee

<script>
var radbut=document.getFormWarpRequest()._oLstChoicesLocation;
radbut.options[0].checked=true;
</script>


I think that's what you're looking for?

venkiatmaruthi

Melee,

I am looking to select the second option not the first option.

That's why I mentioned

radbut.options[1].checked=true;

By the way, both options[0] or options[1] is not working at all.

Thanks.

melee

Sorry! I misunderstood. Have you tried doing this with Default Selections in the prompt? I'd try there first.

Try this:

http://nicbertino.com/?p=63