Fil schrieb:
>> http://bassistance.de/jquery-plugins/jquery-plugin-validation/
>>
>
> Oh it's great.
>
> I wonder though if your choice of writing class="{x:y;z:t}" is not
> potentially problematic.
>
> As I see it:
> - it could be incompatible with CSS2.1 selectors
> - it is probably incompatible with jQuery selectors
> - it is *certainly* going to confuse a few users
> - it might confuse some browsers (though I guess you've tested this)
>
> An alternative would be to write something like
> class="DEF-x-y_z-t"
>
> (but I admit it's much uglier) :)
>
Hey Fil,
thanks for worrying about that, but it was discussed in detail for the
first time more then half a year ago, and kind of standarized by John
with his metadata plugin. Since jQuery 1.1.2, there are no more browser
issues with that format. Whether you use it or not is your choice, the
recommended alternative is settings validation rules via plugin options.
The curly braces are illegal characters for a CSS selector, so there is
no way to confuse those classes with style classes.
The not-so-very-obvious flaw, as pointed out by Andrea, is something
like this: class="{required:'#some element andAnother'}".
That procudes a valid style class "element".
I keep support for the metadata because I can imagine that it is much
easier for a serverside generated form to add additional classes to each
element instead of composing the necessary JavaScript in a seperate
script tag.
--
Jörn Zaefferer
http://bassistance.de
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/