Re: Xforms Validation

Pierre,

I'm not an XForms expert....  But, I think I noticed a possible typo in your 
code...

In

<xforms:bind xforms:id="bind_1" nodeset="instance('instance_0')/champ1"
  type="xs:integer" constraint="string-length()=2" required="true()"/>

You are "typing" your bing to xs:integer     But I don't see the XS name space 
declared.  Is it possible that should be xsd:integer?

I don't know if it makes a difference at the <instance> level, but my xforms 
code has types in my instance variables as well (atleast those that are *not* 
declared in a schema.)

Hope this helps!

Bob

On Thursday 27 May 2004 08:20 am, Pierre Busnel wrote:
>   Hi,
>
>   I've been trying in vain to add constraints to a xforms. What I am trying
> to do is to make sure the user will enter an integer in a certain field. I
> found easy to test the length of a field or others things using Xpath
> functions, but I dont see how I can test the type or how I can use regular
> expressions. In the code below, the user can enter a 2 characters string,
> even if the type is an integer. How can I prevent the user from entering
> anything else than numbers ?
>
>   Regards
>
>   Pierre Busnel
>
> PS: By the way, I think Xforms is the "next big thing". Or I'll be damned
> to try to understand how it works for nothing !!
>

Received on Thursday, 27 May 2004 09:46:28 UTC