cancel
Showing results for 
Search instead for 
Did you mean: 

radioButton and javascript event

Former Member
0 Kudos

Hello,

For ergonomy reason, I need to call a javascript function when user select a radioButton inside a radioButtonGroup.

So I need to have such a onClientClick function called on 1 of these elements.

So:

- Can I call a javascript function on a click event on a

radioButton element ?

- If I can not, can I call a javascript function on a click event on a radioButtonGroup element ?

- Has someone an other solution to do this ?

Thanks,

Fabien

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi All,

I just want to make a note that, the link given by Kirupanand refers to the WebDynPro Radio Button.

I hope, the radio butto refered by Fabien is a htmlb radio button that belongs to Enterprise Portal.

As far as a HTMLB control is concerned,

http://help.sap.com/saphelp_nw04s/helpdata/en/d0/55074155bcf26fe10000000a1550b0/frameset.htm

there is no onClientClick event for the radio button or radiobuttongroup. I too don't know how to implement client-eventing for radio button.

bye

Vijay.K

Message was edited by: vijay kannan

Answers (3)

Answers (3)

Former Member
0 Kudos

hi fabien,

yes its very wel possible to call a javascript function from radio button onclick event. do the following things , it should work .

In your jsp file set the following attribute for radio button.

1.jsObjectNeeded="true"

2. onClientClick = javascript:methodname()

write the following code inside the form.

function methodname() {

var funcName = htmlb_formid+"_getHtmlbElementId";

func = window[funcName];

var radio = eval(func("radiobutton name"));

now radio is the object refering to ur radiobutton . using the methods like getvalue(), gettext() u can play around that

Regards,

Jeyasingh samuel

Former Member
0 Kudos
Former Member
0 Kudos

Try these:

<b>Plz don forget points, if it helped!</b>

Regards,

P.