W3C home > Mailing lists > Public > www-forms@w3.org > June 2007

Re: required attribute

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Mon, 04 Jun 2007 11:00:30 -0700
Message-ID: <4664533E.4090804@orbeon.com>
To: www-forms@w3.org

Daniel,

The default for the required property is already false(), so you don't 
need to set it explicitly to false(). This means that by default all 
values are optional.

But there is a caveat: the empty string is not a valid xs:integer, so if 
your value is blank it will fail validation even if it is not required.

To solve this problem, XForms 1.1 introduces new types which include the 
blank space, so you can use xforms:integer instead of xs:integer:

   http://www.w3.org/TR/xforms11/#empty-content-types

But these may not be supported in your implementation yet (we have yet 
to implement them in Orbeon Forms for example, but we hope to do so real 
soon).

-Erik

Daniel Maier wrote:
> 
> Hi all,
> 
> I'm not sure what I'm doing wrong. I have some bindings which are 
> required=false()
> For strings it works, but if I use any other datatype I can't get it 
> optional.
> Isn't it possible to have e.g. an integer  optional?
> 
> Thanks
> Daniel

-- 
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/
Received on Monday, 4 June 2007 18:00:39 GMT

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