Button_to_function

Hi
I have
<%= button_to_function “Save As Resolved”,{‘class’ => ‘itilbuttonlink1’}
do |page|
page.visual_effect :BlindDown, ‘here_call_sd_resolution_div’
end %>

Here can I use :before clause as in the case of link_to_remote…What I
am trying is before the div ‘here_call_sd_resolution_div’ is shown(by
default its visibility hidden), call a javascript to check a particular
field is empty or not…And I want the div be shown only that field(say
for example a text field) is non empty.How can I do this?

Thanks in advance
Sijo

Hi
I got a solution like below
var showDivIfValuePresent = function(hiddenDiv, formField) {
if($F(formField) {
new Effect.BlindDown(hiddenDiv);
}
}

<%= button_to_function “Save As Resolved”,{‘class’ => ‘itilbuttonlink1’}
do |page|
page.call :showDivIfValuePresent, :here_call_sd_resolution_div,
:someField
end %>

 But I get an error like

ReferenceError showDivIfValuePresent is not defined

What may be the reason?.Please help
Sijo