Closed (fixed)
Project:
Compact Forms
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 May 2011 at 18:19 UTC
Updated:
22 Sep 2012 at 18:07 UTC
Add this snippet to the script.js file of your theme to fix the fact that you can not click the form item through the label in iOS devices.
/* IPHONE CLICK */
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i)) {
$('label[for]').click(function () {
var el = $(this).attr('for');
if ($('#' + el + '[type=radio], #' + el + '[type=checkbox]').attr('selected', !$('#' + el).attr('selected'))) {
return;
} else {
$('#' + el)[0].focus();
}
});
}
You will have to add the Drupal specific bits you need for the JQuery to work on load for either D6 or D7.
Comments
Comment #2
bmx269 commentedNo one else thought this was useful?
Comment #3
drclaw commentedTotally useful. Just used your snippet and it worked like a charm!
Comment #4
bmx269 commentedThanks for the feedback. I don't have a lot to contribute code wise, so I appreciate the fact that it was useful.
Comment #5
casey commentedEven easier is adding onclick="" to the <labels> elements. Or even simpler, to the <body> element.