Instructions

android

Introduction

Creating a project

Form Builder

Adding a Form
          Key Field
          Title

Text Fields
          Plain

          Numeric
          Date
          Time
          Drop-Down
          Radio 
            Check Boxes
          
Media Fields
           Location

           Photo
           Video
           Audio
           barcode

Validation
           Text
           RegEx   
           Double Entry

Form Logic
           Jumps


Linking Forms
           Hierarchy

           Branching

android


Installing EpiCollect+
Loading a Project


Collecting Data

Text Fields
          Plain

          Numeric
          Date
          Time
          Drop-Down
          Radio
             Check Boxes

Media Fields
           Location

           Photo
           Video
           Audio
           barcode

Saving Data

List/Sync data

Maps

Backing up data

Remote Data

Settings

android


Project Website

Map View

Multiple Forms

Downloading Data

android


Introduction

EpiCollect Markup

The Document
           <model>

The Form
           <form>


Text Fields
           <input>

          <select>
           <select1>
          <radio>
Setting defaults

Media Fields
           <location>
           <photo>
           <video>
           <audio>
           <barcode>

Defining keys

Form Logic
           Jumps


Linking Forms
           Hierarchy

           Branching
  
Validating



Setting defaults

 

Setting default values - the default="" attribute

Should you wish to have an item (or items in the case of <select> questions) selected by default, you can specify this using the default="" attribute.

the default="" attribute takes one or more integers as a value, which reference the item(s) you wish to have selected.

Each item in your list is referenced numerically from 1 to n where n represents the last item.

In the case of <select1> and <radio> questions, where the user can only select one option, you can set one of the options to be selected by default as in the following XML (the screenshot shows what the user sees.

 

<select1 ref="select1demo" default="2">  

 <label>What is the school type? Select one</label> 
			
<item> <label>Community School</label> <value>Community</value>
</item> <item> <label>State School</label> <value>State</value> </item>
<item> <label>Other School</label> <value>Other</value> </item>

</select1>

 

defselect1

In this example, the default="" attribute is set to default="2" and 2 refers to the second option in the list - State School , which is automatically highlighted when presented to a user. Defaults are zero indexed due to the way that Android processes select lists, therefors the 'Select' is zero and the options start from one.

This can also be applied in the same way to <radio> inputs.

 

Default options with <select> inputs

The following XML and screenshot demonstrate how to set two options selected by default.

<select ref="selectdemo" default="1,3">  

 <label>What facilities does the school have? Select none,one or more</label> 

   	<item> 
   	 	<label>Swimming Pool</label> 
   	 	<value>swimming</value> 
   	</item> 

   	<item> 
   	 	<label>Gym Facilities</label>
   	 	<value>gym</value> 
   	</item> 
		
   	<item>
   	 	<label>Tennis court</label>
   	 	<value>tennis</value>
   	</item> 
		
</select>

defaultselect

 

 

Next | Media Fields