Hi,
I’m using standard Rails form builder form_for and haml.
I’m trying to replace standard Rails submit button with an image.
In addition Javascript runs on submit event.
How can I replace the f.submit button by an image-based button?
remote_form_for(@message, :html => {:onsubmit => “jQuery()”})
do |f|
= f.error_messages
%table
-
#… regular form fields with some more indentation …
= f.submit ‘Send It’-# I thought this might work, but onsubmit event is not
firing. Plus it’s a security bomb if JS is disabled in browser.
= link_to image_tag(‘message_send.png’), :action =>
‘create’, :method => :post, :id => @message
Would really appreciate your help.
Thank you,
Michael