Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can mix the two approaches, i.e. you can create a form that has, for example, controls generated from two different XML schemas and some from-palette controls. The result will be three documents.===

Top-down forms (from palette)

...

This is the most common type of form where you drag and drop controls from the palette. The form is shown below in the Designer. It contains a Section named Personal. Inside this Section there are two Panels. Each panel has two controls. Below this Section is a Repeating Section called Incident which itself contains two controls.

[[Image:From_Palette_Form_Edit.png|frame|left|Form with Section and Repeat]] [[Image:From_Palette_Form_Use.png|frame|left|Use Mode form filled with data]] <br style="clear: both" />

The form is shown filled in above. We've filled in all the fields and added a second repeating incident. When the form is submitted, frevvo generates an XML document that looks like the one below: <pre>

Code Block
languagejavascript
<ns:form xmlns:ns="http://www.frevvo.com/schemas/_5PqoILXnEeCqU4w2X0ufGw" name="FNLN2">

...

   
    <Personal>     
        <FN>John</FN>     
        <LN>Doe</LN>     
        <EmailAddress>johndoe@yahoo.com</EmailAddress>

...

     
        <Phone>202.202.2020</Phone>

...


    </Personal>

...

   
    <Incident>     
        <Date>2010-08-01</Date>

...

     
        <Description>Parking ticket</Description>

...

   
    </Incident>

...

   
    <Incident>    
        <Date>2010-08-08</Date>

...

     
        <Description>Speeding ticket</Description>

...

   
    </Incident> 
</ns:

...

form>

Note that the structure of the generated XML document matches the structure of the form. You can download an XML schema that describes the document that the form will generate by clicking on the Schema button for the form. See the [[V4_Forms_Home_Page|Forms Home Page]] documentation for details.

If the structure of the form is changed, the generated XML document (and associated schema will change). For example, if you add a new Section - say it's called Info - and nest both the existing Personal Section and the Incident Repeat inside this new Section, the XML document will change to reflect this change as shown below (snipped for brevity): <pre>

Code Block
languagejavascript
<ns:form xmlns:ns="http://www.frevvo.com/schemas/_5PqoILXnEeCqU4w2X0ufGw" name="FNLN2">

...

 
  <Info>     <Personal>       <FN>John</FN>        ...     </Personal>     ...   </Info> </ns:form>

...

 </pre>

Why is this important? It's only important if you are using the form to edit existing submissions, i.e. to edit the XML documents they have generated. To do so, the form must first be initialized using the XML document. If the structure of the XML document does not match the structure of the form (or more accurately, if the XML schemas are incompatible), the initialization will fail and you cannot edit the submission using the form.

...