myFunction 未使用 ActiveAdmin 表单定义 & Rails
myFunction is not defined with ActiveAdmin form & Rails
我不明白为什么我有这个问题。好像我的函数 hiddenField() 没有被读取。
我的表格:
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"
我的脚本:
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);
谢谢。
编辑:
对不起,我忘记了。我的表格在 admin/page.rb。我使用 ActiveAdmin。
$(function() {
$('.select').change(function() {
$('.hidden_title').removeAttr('input')
})
})
我不明白为什么我有这个问题。好像我的函数 hiddenField() 没有被读取。
我的表格:
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"
我的脚本:
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);
谢谢。
编辑:
对不起,我忘记了。我的表格在 admin/page.rb。我使用 ActiveAdmin。
$(function() {
$('.select').change(function() {
$('.hidden_title').removeAttr('input')
})
})