Now, you raise a good point as to how the Javascript could capitalize on the presence of the errorStyle attribute, which normally is only interpreted on page load. That is, if you did any client side validation, you'd probably like to be able to switch the style of the invalid field to whatever was specified in "errorStyle" even if there was no error when the page loaded. This is valuable outside of the specifics of an Ajax situation and would also apply to any client-side validation. Unfortunately, I'm having trouble seeing a particularly clean way to do it which wouldn't involve loading down the base tags (because of single inheritance) and even then, I think you'd have a pretty contentious time getting people to agree on what the base tags should output. I guess maybe you could have some Application scoped "input tag decorator" which could be invoked by the tag if present while still leaving things open for customization...

Joe


This one is simple. HTML ignores attributes it doesn't understand. That means all your input boxes etc. could have an errorStyle attribute defined (and probably a normalStyle as well) and then when the js validation code runs it could look to see if such attributes are defined and then copy the value of errorStyle or normalStyle as appropriate to style when validating. In other words your emitted HTML would look like
<input type="text" name="lastname" style="basicstyle" errorStyle="itsucks" normalStyle="basicstyle" value="King" onChange="some_js_function(this)">
The element renders correctly, validators that don't flip styles ignore the extra attributes validators that use them have them. I know its bizarre, adding atttributes to objects at run-time, but that's the world of the DOM. Its' been a while since I tested this, I believe if I have a text input object in the variable oTxt to find out its "errorStyle" attribute I have to use js like:
var es = oTxt.getAttribute("errorStyle"); // returns null if no such attribute exists.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to