Jump to content

Custom Attributes Valid?


Chandra.Vedantham@gmail.com

Recommended Posts

Hi Gurus,Have one basic query that has been haunting me since a long time.In ASP.Net when we use a validator like the required field validator, it is rendered as a span element.So far so good.Span element also contains some attributes like "controltovalidate", "errormessage", "evaluationfunction" and "initialvalue", which for sure I believe are not a HTML compliant attributes.But strangely they seem to work as the validation process is carried out.How is it possible with the custom attributes in usage?Isn't this not violation of the HTML Standards?Can anyone explain me if I am wrong in my reasning or if this is a valid approach?Thanks.

Link to comment
Share on other sites

I guess the question of whether HTML is "valid" depends on which DTD it specifies... But HTML's never likely to be as strict as XML, and anyway, at the end of the day there's nothing to stop websites using "invalid" HTML, and browser vendors implementing the behaviour of their choice, irrespective of whether others say the HTML is valid or not....

Link to comment
Share on other sites

So does this mean custom attributes can be used in the Commercial Web Designs.I got this doubt when I started working on creating a Tree Menu which is similar to the Microsoft Tree Menu.I was really confused if I can use Custom Attributes to maintain the states of the nodes of the tree and does it work on all browsers.But if a Product from Microsoft is using the custom attributes I just wanted to make sure if it is a part of the HTML standards.Thanks.

Link to comment
Share on other sites

does it work on all browsers
Since browser vendors have traditionally not adhered to one standard, and also due to the (theoretical!) possibility of buggy browsers, I think this comes down to empirical testing, not standards. If you write a web app, you have to test it on the browsers you expect "most" of your target users to be using. I think this will remain true when (or if?) the main browsers become XHTML-based, since users will potentially continue to use all kind of (old) browsers just as at present.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...