Hi Surhabi,

when you looking at client side validation you enter Dante's 7 hells of _javascript_ implementation <g>.
The different browsers handle the DOM very differently and you should stick to the W3C DOM methods for validation. So getElementByID and the likes. What workes for us: Don't try to code _javascript_ with hardcoded field names, however loop through all form elements and have a look at the classes. Use the classes to figure out a validation type (e.g. numeric, required, date as classnames). This way your code is easy to maintain: if a field is gone you looping code will not get it, if you hardcode name you have 2 areas to update!!! I can provide some code for that.

VERY interesting idea: generate the validation _javascript_ using XLST translations from the Schema and/or model. This way validation could do more than just required fields etc.

Hth
:-) stw

[EMAIL PROTECTED] wrote on 24/11/2004 18:13:32:

>
> Hello.
>
> I am trying to achieve client side validation using Orbeon. There
> are a few questions:
>
> 1) Does Orbeon support  DOM Level 2 Event Handling? If so where can
> I find relevant documentation?
>
> 2) The validation of fields that is achieved using "bind" (of the
> model) happens at the server side. As this increases the response
> time, I was looking to implement validation using _javascript_. But
> the problem that I face is how do I identify the controls? E.g. if
> there is a textbox in an html script with name "myText", I can use the "
> document.form.myText" construct in _javascript_ to refer to that
> control. In the context of Orbeon, is it possible to refer to
> controls in some way in _javascript_?
>
> 3) Something elementary like a button does not have an
> implementation in Orbeon. Is this due to lack of event handling support?
>
> Thanks in advance,
> Surabhi

Reply via email to