views:

115

answers:

1

Im doing some form validation on a website and I've tried to use JQuery Validator and it works find but isn't valid as it uses custom attributes. I've tried every which way to make it valid but it seems besides some other custom javascript, which is not an option, it isn't valid.

Has anyone come across one that is valid? Or some other way to make it valid? I've tried custom dtds, adding the attribute to the doctype but that leaves a ]> on the page.

Cheers

+3  A: 

It's possible to setup validation rules purely in Javascript, based on form field IDs (I don't know if ou would count this as 'custom' javascript, but it's standard JQuery Validator stuff).

There's an example you can see here:

http://jquery.bassistance.de/validate/demo/milk/

Cocowalla
mmm, its nice but custom for rules and uses custom attributes again so it fails validation :(
Rudiger
Which custom attributes does this method use?
Cocowalla
I chucked it through the validator and it came up with autocomplete being a custom attribute though im thinking thats not a necessary one. Ill look over it again
Rudiger
I just ran this through the W3C validator, and can't see it complaining about any custom attributes. The few things the validator complains about for this page have nothing to do with JQuery Validator (e.g. autocomplete)
Cocowalla
Not exactly what I was after but did the trick, thanks. Also solved another issue that I wont go into.
Rudiger