I can't figure out why I am facing this issue. It seems like my hiddenField() function is not being recognized.
Here's my form :
f.input :contact, :as => :radio, :collection => ["slide", "contact form", "map", "video"], input_html: {:class => "select", :onblur => "hiddenField()"}
f.input :title_map, label: I18n.t('title_map'), input_html: {:class => "hidden_title"}, placeholder: "Enter a title for the map"
This is my Script :
var ready;
ready = function() {
function hiddenField() {
$(".select").on( 'click', function() {
document.getElementsByClassName("hidden_title").removeAttribute("input");
};
};
hiddenField();
};
$(document).ready(ready);
$(document).on('page:load', ready);
Thanks.
EDIT :
Apologies for forgetting to mention earlier. My form is in admin/page.rb and I'm using ActiveAdmin.