Hi I have an observer that fires on the basis of a drop-down.
I need to change the icon on the submit button of a form based on this
value. I created the submit button using "image_submit_tag".
I have it working with this code in my RJS template:
if params[:type] == "type_a"
page.replace_html "submit_button",
'<input class="submit" src="/images/btn_type_a.gif" type="image" />'
else
page.replace_html "submit_button",
'<input class="submit" src="/images/btn_type_b.gif" type="image"
/>'
end
I expect there is a better way to do this than having to replace the
code generated by my image_submit_tag. I would rather just replace the
image directly.