Using check_box with onclick javascript

Hi,

I am trying to use onclick javascript event, but this doesn’t work:

<%= check_box(“attending_ip”, ‘pm_xray’,{},
‘y’, :onclick=>“insertToDo();” ) %>

how do I make this correct?

thanks,

I found the solution:

<%= check_box(“attending_ip”, ‘pm_xray’,
{:onclick=>“insertToDo(‘pm_xray’);”}, ‘y’ ) %>

Daniel K. wrote:

I found the solution:

<%= check_box(“attending_ip”, ‘pm_xray’,
{:onclick=>“insertToDo(‘pm_xray’);”}, ‘y’ ) %>

can you explain what part relates to what please.

thanks