cancel
Showing results for 
Search instead for 
Did you mean: 

Optional field in web form

grewcg
Champ in-the-making
Champ in-the-making
How can I configure a specific element of a webform to be optional? I've tried to set the minOccurs and maxOccurs attributes to 0 and 1, respectively, but it doesn't work.
3 REPLIES 3

kvc
Champ in-the-making
Champ in-the-making
Hi -

Yes, minOccur='0' should ensure that the element is indeed optional.  If you are a subscribing customer, please open a support case and provide your XSDs so that our support engineers can test it out to see what's happening.  Otherwise, you seem to be doing the right thing.   This is how optional elements are declared.


Kevin

bigbaddev
Champ in-the-making
Champ in-the-making
Hi, I have noticed the same problem using the 2.1.0E and have yet to be able to find a suitable resolution.

here is the relevant line in my XSD file:
<xs:element minOccurs="0" maxOccurs="1" name="contextual_giving">

I have also tried to add the nillable feature, and have yet to see any positive results:
<xs:element minOccurs="0" maxOccurs="1" nillable="true" name="contextual_giving">

finally, i ave also experimented changing the cardinality of the contextual_giving child elements so that they reflect the cardinality of this element and again had no positive results.  In fact, the only way that I have been able to create optional elements in the alfresco WCM is to set the minOcurs="0" and the maxOccurs="2".  It seems as though alfresco is having issues with optional elements with a cardinality of 0-1 because everything functions as expected if the minOccurs=0 and the maxOccurs= 2 (or anything greater than 1).  However, this is not desirable because it allows for extraneous data to be inserted into the site.

Has there been any progress on this issue thus far?  As this is a significant issue for the project I am currently building for a client, I have begun to get a hold of one of my contacts within alfresco to see if there is any sort of resolution in existence, or due to come out in the near future.

Thanks in advance,
Chris

kvc
Champ in-the-making
Champ in-the-making
Chris:


We do not have a JIRA issue filed for this; please file and we will look into.  Also, if this is needed for an important customer project, I recommend opening a support ticket.  That will help you track and escalate this issue.


Kevin