RJS with dynamic value passed into a link_to_function

I would like to write a link_to_function that is dynamic in the sense
that it inserts something into a div based on the value of a hidden
field.

So at the moment I have

page.insert_html :bottom, :div_name, :partial =>
‘partial_name’, :object => 5

I would like to do

page.insert_html :bottom, :div_name, :partial =>
‘partial_name’, :object => value of a hidden form field

If it is not possible by the partial method, is it possible to have

page.insert_html :bottom, :div_name, html string

Where the html string contains some javascript that picks up
the hidden field value.

I know how to do this with raw javascript but would love to do it in a
cleaner rails/RJS fashion.

Thanks for any tips

Anthony

I encourage you to watch this podcast: #45 RJS Tips - RailsCasts
May be, it will be helpful