0

I want to see the specific Contact Form 7 submissions that are sent using mobile devices. So I was wondering how to automatically input screen resolution information in contact form 7 submission.

I tried to use the following method but had no luck. Sending screen resolution via a form

Will really appreciate your kind suggestions.

Community
  • 1
  • 1
HashAB
  • 1
  • Have a look at http://stackoverflow.com/questions/2242086/how-to-detect-the-screen-resolution-with-javascript Once you have the resolution, the form is easy. Do note that adding JS to wordpress also needs some setup, but there's other tutorials/questions for that. – Shilly Feb 09 '17 at 16:16
  • I am not quite sure how it would work. How to parse the script data to CF7 mail shortcode? – HashAB Feb 09 '17 at 16:59

1 Answers1

0

Add a hidden field in CF7 and give it an ID:

<input type="hidden" id="drez" val=""/>

Then add this to your javascript file:

$(document).ready(function() {
    var wRez = $(window).width()+'x'+$(window).height();
       $("input#drez").val(wRez);
});
Spartacus
  • 1,468
  • 2
  • 15
  • 29
  • Thank you for the tips. But did you try it? I can enter it in the form tab of CF7, but what shortcode shall I be using under the Mail tab? – HashAB Feb 10 '17 at 19:22