|Sep 13, 2009, 06:39 AM||#1|
iPhone Safari not honoring 'for' attribute of html label tag...anyone else notice?
This is regarding development of a web app, but this seemed like the most appropriate board for the matter. I'm sure someone will let me know if it isn't...
iPhone Safari isn't honoring the use of the "for" attribute in the <label> tag, as in, it's not selecting the corresponding radio button/checkbox when the content included in the label is touched. I experience this on iPhone OS 3.1, for what it's worth.
<input type="radio" id="foo" name="asdf" value="foo" />
<input type="radio" id="bar" name="asdf" value="bar" />
I'm not able to duplicate the issue in Safari 4.0.3 (6531.9) on OS X 10.6.1.
Has anyone encountered this before?
|May 6, 2011, 01:38 PM||#3|
I have actually been looking around the web to provide this answer, as I couldn't find a resolution when I had this problem myself.
I put the attribute onchange="" on my label, and that made the for="" attribute work.
So, when I was having this problem my code looked like this:
<input type="checkbox" id="chkRemember" name="chkRemember" value="1"/><label for="chkRemember">Remember me</label>
And it didn't work. This did work:
<input type="checkbox" id="chkRemember" name="chkRemember" value="1"/><label onclick="" for="chkRemember">Remember me</label>
I thought i messed something up, so I undid my work then tested, then redid my work and tested again.. sure enough, an empty onchange attribute worked.
Hope this helps,
|May 6, 2011, 02:23 PM||#4|
Which attribute is it: onchange or onclick?
Your code shows onclick, but your description says onchange (twice).
You don't need to post a new reply to this. Simply edit your post and save the changes.
|Dec 11, 2011, 02:23 PM||#6|
It's onclick. I just tested with both onchange and onclick. The one that works is onclick.
<label for="my_check_1" onclick="" > Click my check </label>
<input type="checkbox" name="my_check" id="my_check_1" />
Last edited by philsown; Dec 11, 2011 at 02:24 PM. Reason: Adding code sample
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Safari bug, anyone else notice this one?||YourHerojb||Mac OS X 10.7 Lion||0||Jul 26, 2011 08:36 PM|
|Anyone else notice the new version of Safari shown on the iPad?||WilliamG||iPad||16||Sep 3, 2010 02:34 AM|
|Anyone else notice Best Buy is still selling all of the old white iMac models online?||docprego||Buying Tips and Advice||9||Oct 23, 2007 01:45 PM|
|Anyone else notice that Safari and iPod seem more stable?||iBookG4user||iPhone||1||Jul 28, 2007 11:59 AM|
|Anyone else notice Safari being sluggish?||sigamy||Mac Applications and Mac App Store||3||Nov 3, 2004 01:41 AM|
All times are GMT -5. The time now is 12:41 AM.