nillable=false equals required? - InfoPath Dev
in

InfoPath Dev

nillable=false equals required?

Last post 09-28-2006 01:05 PM by jeverton3. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-28-2006 08:39 AM

    nillable=false equals required?

    Hi all,

    I've been reading a lot about the difference between not required and optional, and I thought I understood it, but my form seems to disagree.

    I have some elements that are strings that I would like to make required (meaning they better be filled) from the schema if possible. I have this in my schema:

    <xs:element name="someName" type="xs:string" nillable="false">

    The way I understand it, string-type elements are not-required by default, so I expected to need to add nillable=false to make them required. I added that (as seen above), and they are still "not required" (i.e., no red * appears when they are left blank).

    Did I misunderstand this article? Why can't I make a string element required from the .xsd?

    thanks,

    Joe
  • 09-28-2006 12:32 PM In reply to

    Re: nillable=false equals required?

    You should be able to do this from the designer. Add custom data validation so that if the length of the current field is equal to zero, then it is invalid. I don't think you should be digging around in the XSD unless you absolutely have to.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 09-28-2006 01:05 PM In reply to

    Re: nillable=false equals required?

    I agree in general that I shouldn't be digging around in the schema much, but I have to say, if I have 20 elements I want to make read-only, I would rather do it in the schema (possibly by defining and using a type) than add the same rule 20 times manually.

    Is there any shortcut for adding the same rule to a bunch of fields? All the mousing and lack of rule reuse was what was turning me away from this approach.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.