javascript - myFunction is not defined with ActiveAdmin form & Rails -


i don't understand why have issue. it's function hiddenfield() not read.

my form :

f.input :contact, :as => :radio, :collection => ["slide", "formulaire de contact", "map", "video"], input_html: {:class => "select", :onblur => "hiddenfield()"} f.input :title_map, label: i18n.t('title_map'), input_html: {:class => "hidden_title"}, placeholder: "entrer un titre pour la map" 

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 :

sorry, forgot. form in admin/page.rb. use activeadmin.

$(function() {   $('.select').change(function() {     $('.hidden_title').removeattr('input')   }) }) 

Comments