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 => [b]value of a hidden form field[/b]

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

page.insert_html :bottom, :div_name, [b]html string[/b]

Where the [b]html string[/b] 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: http://railscasts.com/episodes/45
May be, it will be helpful