PDA

View Full Version : Compliance Rules


A1ien51
04-22-2003, 03:11 AM
if I enter information into a tag like the following

<input type="text" name="blah" theinfo="TheStuff" value="def">

is "theinfo" allowed or will it make it not compliant under the rules that I can not seem to find today, google is letting me down or I am blind!

A1ien51

beetle
04-22-2003, 03:23 AM
It works, it just won't validate at validator.w3.org

I've used some custom attributes from time to time. That's what XHTML is supposed to allow us. You can extend the DTD, but IE renders a small piece of the code that does that. Very annoying.

Just be aware that your custom attributes aren't exposed as properties, and you'll have to use setter/getter methods for accessing them.

x_goose_x
04-22-2003, 03:34 AM
document.forms[x].blah.setAttribute("theinfo","test");
tmp = document.forms[x].blah.getAttribute("theinfo");
alert(tmp)
//alerts "test"

brothercake
04-22-2003, 03:53 AM
this (http://www.codingforums.com/showthread.php?s=&threadid=11384) is the DTD extension beetle was referring to

You could always cover it up with an absolutely positioned element :rolleyes: ;)

btw - getAttribute and setAttribute are both buggy in Opera and IE - http://www.xs4all.nl/~ppk/js/w3c_core.html#attributes for info

My own experience is that in win/ie6:

obj.setAttribute('foo','bar');

may not work; whereas:

obj.setAttribute('foo','');
obj.foo = 'bar';

usually does.

A1ien51
04-22-2003, 05:08 AM
You could always cover it up with an absolutely positioned element ......

LOL

Now it sounds like trying to add 500 extra functions for code to work in NS4, but now with IE...


I want to see if I can get this incorporated with my large project, this will be fun! LOL!

Thanks for your input on this subject.....
A1ien51