- This topic has 5 replies, 2 voices, and was last updated 8 years, 7 months ago by Ernest Marcinko.
-
AuthorPosts
-
February 17, 2016 at 4:07 pm #7731ViitamiParticipant
Hi,
When I add Ajax search pro on our site as fixed (by adding the shortcode for templates to the header of the site) I can’t fill details in the contact form inputs when viewing the site on mobile phone.
Is the header wrong place to add the <?php echo do_shortcode(‘[wpdreams_ajaxsearchpro id=1]‘); ?> shortcode or what might be wrong?
Is it possible to not load the search when viewed with mobile devices?
Thanks,
MikoFebruary 17, 2016 at 4:45 pm #7732Ernest MarcinkoKeymasterHi!
If you use the search form on a different location (footer widget, sidebar etc..), then is it working?
I don’t think the location should make any difference in this case.Can you link me to a page where the plugin and the contact form is active? I would like to check this out on my mobile to see if there are any error messages or anything related.
I’m not sure if loading on non-mobile is possible, but there is actually a built-in server side mobile detection function called wpdreams_ismobile() in ajax search pro, so you can try to change the shortcode to something like:
[php]<?php if ( wpdreams_ismobile() == 0 ) { echo do_shortcode(‘[wpdreams_ajaxsearchpro id=1]’); } ?>[/php]
Although I’m not sure if that will work, the plugin might not be loaded in the header stage yet, so it might show a warning that the function is not defined, but it’s worth a try.
February 17, 2016 at 5:03 pm #7733ViitamiParticipantYou cannot access this content.
February 17, 2016 at 5:12 pm #7734Ernest MarcinkoKeymasterIndeed, there is some connection, I was able to re-create the problem on my test environment with similar fields. I will have to investigate this further to find what is exactly causing it to fix it before the upcoming release.
Until then, I have found a temporary solution, which might work for you as well. Put this script into the footer.php file of your current theme:
[html]
<script>
jQuery(function($){
$("._full_width input").click(function(e){ e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
});
});
</script>
[/html]This should prevent any click related events on the contact form.
February 17, 2016 at 5:51 pm #7735ViitamiParticipantYou cannot access this content.
February 17, 2016 at 5:54 pm #7736Ernest MarcinkoKeymasterOh yeah, I forgot about textareas and possible select fields. Change the code to:
[html]<script>
jQuery(function($){
$("._full_width input, ._full_width textarea, ._full_width select").click(function(e){
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
});
});
</script>[/html]That should include everything.
-
AuthorPosts
- You must be logged in to reply to this topic.