Eliminate Red (Required Field) Asterisk?

M

mikeg

When a using a database as a data source, controls display a red asterisk in
required fields. In this case, we’re using a Master/Detail control, but
submit is disabled because it’s intended for use as a query-only form.
Anyway, the red asterisks show up in required fields in both the master and
detail sections.

Is there a way to stop the red asterisk from displaying?

Thanks,
mikeg
~~~~~~~~~~~~~~~~~~~
Those who give up freedom in exchange for security usually end up with
neither. - Benjamin Franklin
 
M

mikeg

Kalyan, thanks for the suggestion. However, this solution appears to require
modification for my case. The relevent XML schema (in this case schema1.xsd)
is using "attribute" tags for each field in the ADO connection. The solution
on MSDN refers to using nillable="true" in "element" tags. Using
nillable="true" in an attribute tag causes an error (at least when I tried
it).

Being kind of new to all this, I could be missing something obvious. Here's
part of the schema in case someone can point out where to modify it to
eliminate red asterisks in the PATIENT_ID field:

xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields">
<xsd:element name="PATIENT">
<xsd:complexType>
<xsd:attribute name="PATIENT_ID" type="xsd:int" use="required"/>
<xsd:attribute name="LAST_NAME" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="30"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
....[more fields]...
<xsd:anyAttribute
namespace="http://schemas.microsoft.com/office/infopath/2003/adomapping"
processContents="skip"/>
</xsd:complexType>
</xsd:element>
 
K

Kalyan Reddy

Hi,

Try removing use="required" from the
<xsd:attribute name="PATIENT_ID" type="xsd:int" use="required"/>
<xsd:attribute name="LAST_NAME" use="required">
 
M

mikeg

Yeah, I thought that was a good idea too. To be more precise, I tried
changing use="required" to use="optional" which is how some fields in the
data connection are set--corresponding to columns in the underlying View that
are allowed to be NULL.

Unfortunately that didn't have any effect. The red asterisk was still there.
Also I noticed other non-key fields in the data connection where
use="required", but there is no red asterisk. I would think InfoPath is
inserting the asterisk when a field is a key, but the only other control
being marked with this asterisk is SSN which is NOT a key in the underling
table!

It would be nice if Microsoft would expose the logic behind this cosmetic
anomally. Or maybe they have and I just haven't found it yet. Thanks again
for some good suggestions.
Try removing use="required" from the
<xsd:attribute name="PATIENT_ID" type="xsd:int" use="required"/>
<xsd:attribute name="LAST_NAME" use="required">

Kalyan Reddy
Visit http://www.autonomysystems.com


mikeg said:
Kalyan, thanks for the suggestion. However, this solution appears to require
modification for my case. The relevent XML schema (in this case schema1.xsd)
is using "attribute" tags for each field in the ADO connection. The solution
on MSDN refers to using nillable="true" in "element" tags. Using
nillable="true" in an attribute tag causes an error (at least when I tried
it).

Being kind of new to all this, I could be missing something obvious. Here's
part of the schema in case someone can point out where to modify it to
eliminate red asterisks in the PATIENT_ID field:

xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields">
<xsd:element name="PATIENT">
<xsd:complexType>
<xsd:attribute name="PATIENT_ID" type="xsd:int" use="required"/>
<xsd:attribute name="LAST_NAME" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="30"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
...[more fields]...
<xsd:anyAttribute
namespace="http://schemas.microsoft.com/office/infopath/2003/adomapping"
processContents="skip"/>
</xsd:complexType>
</xsd:element>
 
J

Josiah Smith

This may help you. I had the same problem with cloning nodes of base64 type.

Go to infopathdev.com
(http://infopathdev.com/howto/examples/default.aspx?i=cd6b81a217de40a1b249ab42fcff0216)
and download the form "Identifying a Filtered Table Row Number, v1.0" and
read over the setnil function in their script file.

I've found that you have to use the same thing for a Date field when
programatically creating a node, as well as the aforementioned base64
(picture) to set them as 'blank'.

HTH,
Josiah Smith

mikeg said:
Yeah, I thought that was a good idea too. To be more precise, I tried
changing use="required" to use="optional" which is how some fields in the
data connection are set--corresponding to columns in the underlying View that
are allowed to be NULL.

Unfortunately that didn't have any effect. The red asterisk was still there.
Also I noticed other non-key fields in the data connection where
use="required", but there is no red asterisk. I would think InfoPath is
inserting the asterisk when a field is a key, but the only other control
being marked with this asterisk is SSN which is NOT a key in the underling
table!

It would be nice if Microsoft would expose the logic behind this cosmetic
anomally. Or maybe they have and I just haven't found it yet. Thanks again
for some good suggestions.
Try removing use="required" from the
<xsd:attribute name="PATIENT_ID" type="xsd:int" use="required"/>
<xsd:attribute name="LAST_NAME" use="required">

Kalyan Reddy
Visit http://www.autonomysystems.com


mikeg said:
Kalyan, thanks for the suggestion. However, this solution appears to require
modification for my case. The relevent XML schema (in this case schema1.xsd)
is using "attribute" tags for each field in the ADO connection. The solution
on MSDN refers to using nillable="true" in "element" tags. Using
nillable="true" in an attribute tag causes an error (at least when I tried
it).

Being kind of new to all this, I could be missing something obvious. Here's
part of the schema in case someone can point out where to modify it to
eliminate red asterisks in the PATIENT_ID field:

xmlns:d="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields">
<xsd:element name="PATIENT">
<xsd:complexType>
<xsd:attribute name="PATIENT_ID" type="xsd:int" use="required"/>
<xsd:attribute name="LAST_NAME" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="30"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
...[more fields]...
<xsd:anyAttribute
namespace="http://schemas.microsoft.com/office/infopath/2003/adomapping"
processContents="skip"/>
</xsd:complexType>
</xsd:element>
 

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