我在我的WordPress网站上使用了重力形式。我选择了州和邮政编码的下拉列表。我还选中了"增强的用户界面"复选框,但是,它没有在移动设备的下拉字段中启用选择。
下拉字段的屏幕烟灰
是否有任何选项可以选择或重力形式以在移动设备上启用选择。
非常感谢您的回复。
一年后,有一个可能的解决方案给你 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);
相同的解决方案,但进行了更新以修复语法问题。
/* Fix for chosen 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);