cancel
Showing results for 
Search instead for 
Did you mean: 

Preselect Htmlb Radiobutton using javascript

Former Member
0 Kudos

Hi Experts,

when I click on a button, i want to preselect a radiobutton using javascript.

I am using below code to get the instance of the radiobutton in the javascript, but I am unable to select the radiobutton.

var theRadio = eval(func(grpId + htmlb_radiobuttonmodifier.substring(3,7)+ "1"));

Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Try alerting "(theRadio.type)".

If you are getting the proper checkbox instance then the alert should display "checkbox". If that much is working then checking the checkbox is as simple as


var theRadio = eval(func(grpId + htmlb_radiobuttonmodifier.substring(3,7)+ "1"));
if(theRadio)
   theRadio.checked = true

By the way what does the function "func" do?

Regards,

Satyajit

Former Member
0 Kudos

This will NOT work for HTMLB radiobutton. I want solution for HTMLB radiobutton not HTML.

<hbj:radioButton

id="Second"

text="Test2"

key="Two"

jsObjectNeeded="true"

/>