Hi Stephan, Gary, Marius > Betreff: [Zope3-dev] Re: [Checkins] SVN: > z3c.form/trunk/src/z3c/form/ HTMLelement ids containing dots > are not very good, because then the > > > On Jun 3, 2007, at 12:58 PM, Stephan Richter wrote: > > > Log message for revision 76258: > > HTML element ids containing dots are not very good, > because then the > > "element#id" CSS selector does not work and at least in > firefox the > > attribute selector ("element[attr=value]") does not work > for the id > > either. > > > > Thus I converted the entire codebase to use dashes in ids > instead. I > > am > > sorry if this causes some test-fixing issues for some of you, but > > making > > this change sooner rather than later is better in the long run. > > > > I am going to test this some more now. > > Hey. I've only had limited time to look at the new > package(s) but what I've seen so far looks good. I hope to > give it a whirl soon. > > You may want to check about the browser compatibility of > having ids and names different. I know I used to have IE > problems when I did this. I tried to Google for > verification. I think you'll find some > here: > > http://channel9.msdn.com/wiki/default.aspx/ > Channel9.InternetExplorerProgrammingBugs > > Look for the section titled "META tags improperly "register" > them selfs as an ID with document.getElementById()", specifically the > *second* example. AFAIK, this would be an IE6 thing; I don't > have much hands-on pain knowledge with IE7. > > In fact, HTML 4 does regard name and id to be in the same > namespace for anchor tags (see > http://www.w3.org/TR/html4/struct/links.html, > 12.2.3) and even requires that they be identical (example is > in the section). The IE bug, apparently, is to assume that > this constraint holds for all name attributes, such as form fields. > > So, what you did is technically correct. However, if you > want your code to be used be folks who care about supporting > IE6 and JS, I believe you will want your names and ids to be > identical.
Agreed, we can't use different names and ids! We can use camel bucket names instead of dots. This means we can convert each first letter of a prefix to a uper case letter. But the first letter should be lower case. This wil give us names and ids like: formWidgetsLastname rather then: form.widgets.lastname This should also work if somebody uses already a camel bucket name for lastName e.g. form.widgets.lastName /formWidgetsLastName because we do not need to resolve/split the prefix based on the formWidgetsLastName string base. We do only split such prefixed strings based on the prefix parts itself. But another question is, why do we use additional dots or someting else between prefixes? I guess we should skip it and just append each prefix. This alloes us to use the pattern above as well by choosing our own camel bucket names if needed. Any reason for using dot prefix for our prefixes? If not I propose to skip the additional dots which are only beautifiers. What do you think? > I've rung this alarm bell before in other contexts, but this > is the first time I was able to find corroboration. > > Gary > _______________________________________________ > Zope3-dev mailing list > Zope3firstname.lastname@example.org > Unsub: > http://mail.zope.org/mailman/options/zope3-dev/dev%40projekt01.ch > > _______________________________________________ Zope3-dev mailing list Zope3email@example.com Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com