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 for radiobutton

Started by knip, 13 Mar 2018 09:10:28 PM

Previous topic - Next topic

knip

Can someone help me with a javascript which automatically selects the first value of the radio button prompt?

Pratap Reddy

Hi,

You can use Default Selections in the Properties Pane of Radio Button Prompt.

Eg: 2010,2011,2012,2013 are there in Radio Button Prompt.

You can give 2010 in the Default Selections

Regards,
Pratap

Pratap Reddy

Quote from: knip on 13 Mar 2018 09:10:28 PM
Can someone help me with a javascript which automatically selects the first value of the radio button prompt?

<form><div>
<input type="radio" name="Parameter1" 
name="Year" value="2010" checked>
</div>
</form>


Regards,
Pratap

BigChris

But what would you need in a variable list of values? Say for example you were going to limit the radio button prompt to be the last ten years...how would you select the first value regardless of what year it was?

Pratap Reddy

Hi,

This have to work...

<script type = "text/javascript">
var fW =(typeof getFormWarpRequest == "function"? getFormWarpRequest() : document.forms["formWarpReguest"]);
if (fW)
{
if (fW._oLstChoicesMyList.length >= 1)
{
fW._oLstChoicesMyList.selectedIndex = 0;
}
}
</script>

Name the Miscellaneous to MyList.

Regards,
Pratap