W3C home > Mailing lists > Public > www-forms@w3.org > November 2008

validating an xform

From: Jabba Laci <jabba.laci@gmail.com>
Date: Mon, 24 Nov 2008 16:07:45 -0500
Message-ID: <310fbb00811241307p1923c4ebp5e5bbff1f23bfd07@mail.gmail.com>
To: xforms <www-forms@w3.org>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:14 GMT