Calling local js function within form_remote_tag

Hi ,

I am trying to pass an additional parameter using the form_remote_tag like this

<script> function nowActive(){     return 'somestring'       } </script>

<%= form_remote_tag :update => '', :url => { :action => 'send_msg', :to => nowActive()}, :after => "clearinput()" %> <%= text_field_tag :newmessage, nil, {:size => "210", :maxlength => "1000",:autocomplete => "off"} %> <%= end_form_tag %>

On running the page I get the template compile error, saying that nowActive is not a method in my controller class.

I guess it's checking for the method on the server side, where I want to pass the parameter value derived from a local js function.

Please help.

Thanks, ~Shishir