validating an xform

Hi,

I'm new to the list. I'd like to ask your help to clarify some things
because I don't know what is the best practice for my issues. The
problem is the following: I have an xform where input widgets can have
some constraints (e.g. a field can only accept integers from an
interval, or some fields are required, etc.). How to check if the form
satisfies these constraints?
(1) Should it be done on the client side with JavaScript? or
(2) Should it be checked on the server side with a servlet for instance?

I'm using the Mozilla XForms add-on, and I made a test with the 2nd
case. The servlet can tell if the form is correct or not, but if it's
not correct, the user should be able to correct it. However, if I
click on "back", the xform is re-initialized, i.e. it's empty again :(
I'm just thinking: if the form is incorrect, should the servlet show
it again and simply replace the empty XML model part with the one that
was sent by the user? In addition, it should print some info for the
user. Thus, the user can advance incrementally. Is there an easy way
for this?

If case (1) is the preferred way, could someone please send me an
example? I'm not a JavaScript magician.

Thanks,

Laszlo

Received on Tuesday, 25 November 2008 07:40:56 UTC