【发布时间】:2018-06-11 20:17:59
【问题描述】:
我在我的 WordPress 网站上使用了重力形式。我选择了州和邮政编码的下拉菜单。我还检查了 Enhanced user interface 复选框,但是,在移动设备的下拉字段中没有启用它。
是否有选择或重力形式的任何选项可以在移动设备上启用选择。
非常感谢您的回复。
【问题讨论】:
标签: wordpress jquery-chosen gravity-forms-plugin gravityforms
我在我的 WordPress 网站上使用了重力形式。我选择了州和邮政编码的下拉菜单。我还检查了 Enhanced user interface 复选框,但是,在移动设备的下拉字段中没有启用它。
是否有选择或重力形式的任何选项可以在移动设备上启用选择。
非常感谢您的回复。
【问题讨论】:
标签: wordpress jquery-chosen gravity-forms-plugin gravityforms
一年后,你有一个可能的解决方案https://stackoverflow.com/a/41741782/390946
我今天遇到了这个问题。我使用了上面提供的解决方案,并在主题的functions.php 中为init 添加了一个额外的操作挂钩,以取消注册选择的重力形式并添加自定义脚本。
例子:
/**
* Fix for chose not working on mobile devices.
*/
function [theme alias]_fix_gform_chosen_mobile() {
wp_deregister_script('gform_chosen');
wp_register_script('gform_chosen', path_join(get_stylesheet_directory_uri(), 'js/chosen.jquery.fix.min.js'), ['jquery'], '1.10.0-fix');
}
add_action('init', '[theme alias]_fix_gform_chosen_mobile', 11);
【讨论】: