Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Can't fill contact form inputs when fixed search is added to the site
This topic contains 5 replies, has 2 voices, and was last updated by Ernest Marcinko 8 years, 7 months ago.
- AuthorPosts
- February 17, 2016 at 4:07 pm #7731
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 #7732Hi!
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 if ( wpdreams_ismobile() == 0 ) { echo do_shortcode('[wpdreams_ajaxsearchpro id=1]'); } ?>
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.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 17, 2016 at 5:03 pm #7733You cannot access this content.February 17, 2016 at 5:12 pm #7734Indeed, 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:
<script> jQuery(function($){ $("._full_width input").click(function(e){ e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); }); }); </script>
This should prevent any click related events on the contact form.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 17, 2016 at 5:51 pm #7735You cannot access this content.February 17, 2016 at 5:54 pm #7736Oh yeah, I forgot about textareas and possible select fields. Change the code to:
<script> jQuery(function($){ $("._full_width input, ._full_width textarea, ._full_width select").click(function(e){ e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); }); }); </script>
That should include everything.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.