How do you make a text field Read Only after it is saved and distibuted? | Community
Skip to main content
July 21, 2010
Solved

How do you make a text field Read Only after it is saved and distibuted?

  • July 21, 2010
  • 23 replies
  • 16555 views

How do you make a text field read only after it is saved and distibuted?

LiveCycle Designer ES 8.2

This JavaScript code on the exit event:

textField1.access = "readOnly";

This works after the user loses focus on the field, however after it is saved and distributed, that field is no longer "read-only".

I need to have staff insert information into a text field and then distribute it out to customers, and those fields have to be protected.

How do you do this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by

No ....it must be there to be a valid schema....but it is not used by the product when offline.

Paul

23 replies

July 29, 2010

Chnaging the binding to the schema will affect that ....but you can bind the same node in the schema to multiple fields

so simply bind the appropriate node to each individual field.

Ultimately you have to bind each individual field (unless the structure of the schema matches the form exactly).

Paul

July 29, 2010

I will apologize in advance if this is a stupid question, but when you refer to node, what do you mean?

Eve Tracy

July 29, 2010

A field in the schema......i.e.

<root>

     <Field1>test</Field1>

</root>

root is a node and Field 1 is a child node of root. The value of the node Field1 is test

Paul

July 29, 2010

Just to expand a little on what Paul said.  A node can be in many places including but not restricted to the root:

<root>

  <address>

    <street>123</street>

    <city>Chicago</city>

  </address>

  <bio>

    <name>john doe</name>

    <age>62</age>

  </bio>

  <jobs>

    <job>123</job>

    <salary>13.55</salary>

    <job>456</job>

    <salary>12.34</salary>

  </jobs>

</root>

Root, address and bio are all nodes.  Jobs is a node as well, but it is a repeating segment in that you can have many jobs.  When you build the xsd you will have that in the file.  AFA xsd is concerned, put in a couple of those jobs nodes so it will build it with the repeating option.

July 29, 2010

Okay, I think I understand the jest of it, when I bind the schema to the form, I need to define it to a subform or root to keep the global fields intact. 

I think I have the schema coded properly, but I could use second set of eyes that understands it better than I do (1 day tutorial).  I will add the form elements in () for those people out there like me that never had to do one of these before.  Comments are commented out with //.

Still trying to figure out the right way to define the location w/out a url address for the schema file.

<?xml version="1.0"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

targetNamespace="http://www.w3schools.com"

xmlns="http://www.w3schools.com" elementFormDefault="qualified">    //Have to figure out how to define file location w/out URL

<xs:element name="form1"> (form1 - root)

       <xs:complexType>

            <xs:sequence>

                  <xs:element name="Wrapper"> (Wrapper - subform)

                        <xs:complexType>

                             <xs:sequence>

                                   <xs:element name="Attendee">  (Attendee - subform)

                                         <xs:complexType>

                                             <xs:sequence>

                                                    <xs:elemnt name="FormID" type="xs:string"/> (FormId - text field)

                                                    <xs:element name="ProgramNumber" type="xs:integer"/>(ProgramNumber - number field)

                                                    <xs:element name="Sponser" type="xs:string"/> (Sponser - text field)

                                                    <xs:element name="TrainingLocation" type="xs:string"/>(TrainingLocation - text field)

                                                    <xs:element name="State"> (State - text field)

                                                         <xs:simpleType>

                                                             <xs:restriction base="xs:string">

                                                                  <xs:patten value="[A-Z][A-Z]"/>  //Restrict to 2 capital letters

                                                             </xs:restriction>

                                                        </xs:simpleType>

                                                   </xs:element>

                                                   <xs:element name="ProgramDate" type="xs:date"/> (ProgramDate - date field)

                                                   <xs:element: name="EndDate" type="xs:date"/> (EndDate - date field)

                                           </xs:sequence>

                                     </xs:complexType>      

                               </xs:element>

                          <xs:element name="TrainingProgram">  (TrainingProgram - subform)

                               <xs:complexType>

                                    <xs:sequence>

                                         <xs:element name="body">   (body - subform)

                                              <xs:complexType>

                                                   <xs:sequence>

                                                        <xs:element name="Table">  (Table - table element)

                                                             <xs:complexType>

                                                                  <xs:sequence>

                                                                       <xs:element name="HeaderRow" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:dataNode="dataGroup"/>  (HeaderRow - 1st table row)

                                                                           <xs:complexType>

                                                                                <xs:sequence>                                                            

                                                                                     <xs:element: name="C1" type="xs:string"/>  (C1 - text field)

                                                                                     <xs:element: name="C2" type="xs:string"/>  (C2 - text field)

                                                                                     <xs:element: name="C3" type="xs:string"/>  (C3 - text field)

                                                                                     <xs:element: name="C4" type="xs:string"/>  (C4 - text field)

                                                                                     <xs:element: name="C5" type="xs:string"/>  (C5 - text field)

                                                                                </xs:squence>

                                                                           </xs:complexType>

                                                                      </xs:element>              

                                                                 <xs:group name="Item">  (Item - 2nd table row) //This is a group-will be duplicated - dynamic row

                                                                      <xs:complexType>

                                                                           <xs:sequence>  //maxOccurs="unbounded" means unlimited

                                                                                <xs:element name="ItemIndex" type="xs:integer"maxOccurs="unbounded"/> (# field)

                                                                                <xs:element name="Cert" type="xs:integer"maxOccurs="unbounded"/>  (# field)

                                                                                <xs:element name="LastName" type="xs:string"maxOccurs="unbounded"/> (text field)

                                                                                 <xs:element name="FirstName" type="xs:string"maxOccurs="unbounded"/> (text field)

                                                                                <xs:element name="C1_Hours" type="xs:integer"maxOccurs="unbounded"/> (# field)

                                                                                <xs:element name="C2_Hours" type="xs:integer"maxOccurs="unbounded"/> (# field)

                                                                                <xs:element name="C3_Hours" type="xs:integer"maxOccurs="unbounded"/> (# field)

                                                                                <xs:element name="C4_Hours" type="xs:integer"maxOccurs="unbounded"/> (# field)

                                                                                <xs:element name="C5_Hours" type="xs:integer"maxOccurs="unbounded"/> (# field)

                                                                                <xs:element name="ConcatData" type="xs:string"maxOccurs="unbounded"/>(text field)

                                                                          </xs:sequence>

                                                                    </xs:complexType>

                                                               </xs:group>

                                                          </xs:sequence>

                                                     </xs:complexType>

                                                </xs:element>

                                           </xs:sequence>

                                      </xs:complexType>

                                 </xs:element>

                           </xs:sequence>

                       </xs:complexType>      

                   </xs:element>

               </xs:sequence>

            </xs:complexType>

        </xs:element>

     </xs:sequence>

  </xs:complexType>

</xs:element>

           

</xs:schema>

Eve Tracy

July 29, 2010

Is it possible to run an XML schema on a stand-a-lone form?

Eve Tracy

July 30, 2010

Not sure I understand your question ......you can use a schema as a starting point for any form. The schema merely gives the

data that is being collected structure.

Paul

July 30, 2010

My form is stand-a-lone, it will have no database nor is it placed on a website. Everything I have read about xml schema has some sort of http: data connection it seems like. I am confused about the this part.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

targetNamespace="http://www.w3schools.com"

xmlns="http://www.w3schools.com" elementFormDefault="qualified">

How would I reference a file location without using the a URL/URI/URN?

Eve

July 30, 2010

Those links are neccessary when defining the schema but are only used to validate the data taht is generated against the schema. That is not part of what you are doing so it will not be a problem for you.

Paul

July 30, 2010

So I can leave that out?

Eve