Hidden Required Fields upon submitting Form

J

jmamakes3

I am Business Analyst not a programmer trying to create an Infopath form that
has required fields.

Issue if "Is this a Provider or Resource" = Resource
then Resource Field is required and
Provider Last Name and Provider First Name fields are hidden
If "Is this a Provider or Resource" = Provider
then Provider Last Name and Provider First Name fields are visible and
required and
Resource Field is hidden

What do I do when upon submitting the form, I get the message that it
contains validation errors. Errors are are marked with either a red asterisk
(Required) or red dashes.

The programmer manager told me I am making the form to difficult and to
remove the required fields but this defeats the purpose of the form.

Any help appreciated.

Thank you
Maria
 
K

K.Ramana Reddy

hi,

Use below code before saving the form,
thisXDocument.Errors.DeleteAll()(this is for C#)

I hope this will help for you.
 
J

jmamakes3

K. Ramana,
Thank you for the update, quick question, where do I exactly insert the
specific code, towards the end of the existing code? I have inserted the
last section of my current code

Since I am not a programmer I am not sure how to actually write the string
of code
<xsd::restriction>
</xsd:simpleType>
<xsd:simpleType name="this ProviderDocument.Errors.DeleteAll()">
<xsd:restriction base="xsd:anyURI">
<xsd:minLength value="1"/>
</xsd:restriction>

LAST Section of Code:
</xsd:element>
<xsd:element name="Provider_Number" type="xsd:string"/>
<xsd:element name="IDX3" nillable="true" type="xsd:boolean"/>
<xsd:element name="IDX123" nillable="true" type="xsd:boolean"/>
<xsd:element name="Epic_Assigned" nillable="true" type="xsd:boolean"/>
<xsd:simpleType name="requiredString">
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="requiredAnyURI">
<xsd:restriction base="xsd:anyURI">
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="requiredBase64Binary">
<xsd:restriction base="xsd:base64Binary">
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>

Thank yo
--------------------------------------------------------------------------------------------
 
B

Bob C.

Another good approach that doesn't require code is to use Data Validataion
settings. To make this work for you you would remove ther required setting
from the field/node in question. Then through validation settings on the
"Resource Field" set validation.
 
J

jmamakes3

Bob,
Thank you for the different approach.

I think this is working thus far except that for a repeating table that I
just one the first row to be filled out but any subsequent rows are not
needed. Currently if the first four rows are filled out the code thinks the
fifth row needs populating also.

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top