Wiki Spaces


Get Help from Others

Q&A: Ask OpenMRS »
Discussion: OpenMRS Talk »
Real-Time: IRC Chat


Skip to end of metadata
Go to start of metadata

Implementer shortcuts: Getting Started  |  HTML Reference  |  Javascript ReferenceRelease Notes

Developer shortcuts: Technical Overview | Collaborating on Html Form Entry Using Git

Other examples: How to Embed HTML Form (generated by HTML Form Entry module) in a custom module


The HTML Form Entry allows anyone with basic HTML programming skills and a knowledge of the OpenMRS system to create forms. It is an alternative to the Infopath FormEntry module in many (but not all) cases.

The key point about writing forms with this module is that you only have to write HTML (with some special tags for things in the OpenMRS model) and the module will automatically "just know" what to do when the user clicks the submit button.

Currently a form submission creates one encounter for one patient.


  • OpenMRS 1.6.3+, OpenMRS 1.7.2+, OpenMRS 1.8+, OpenMRS 1.9+
  • Note that although the module technically supports OpenMRS 1.7.2+, if you are running OpenMRS 1.7.x we strongly recommend upgrading to OpenMRS 1.8 as there may be some instability
  • If you are using OpenMRS 1.9+ you should also install the htmlformentry19ext module.

Comparison with Infopath FormEntry module


  • Forms are entered in-the-webapp. No need for installed software on the client.
  • You can review a form after entering it and have it look "just like you entered it"
  • Form submission immediately creates data (i.e. no waiting for queues to be processed.)


  • No WYSIWYG editor (though one is in the works)
  • Support for scripted behavior is limited (and requires Javascript programming)

Want to help improve this module? Contact Mark Goodrich.



  1. Download the module from the repository and install it.
  2. Go to "Manage HTML Forms" under the administration page.   (Make sure you are looking at the "HTML Form Entry" section, not the "Forms" section!)
  3. Create a new form there (click "New HTML Form").
  4. Fill out the necessary information; including the Name, Description, Version, and select the Encounter Type from the list.  (When an HTML form is submitted, it will create this type of encounter.)
  5. Save the form.  Then it will open the page for editing the HTML Form.
  6. Customize the HTML form to your specifications. Recent versions of the HTML Form Entry Module include a basic form that can be customized. For additional documentation on the HTML tags that are available, see the HTML Reference.


Creating new HTML Form

Adding a new or editing a form

Filling out a form

Note that if you put in an illegal value (per the constraints in the concept dictionary) it is immediately flagged.

Viewing a form

This looks pretty close to the initial entry.

Example HTML

Here's the code behind the screenshots

Global Properties

  • htmlformentry.dateFormat: (added in HFE 1.9) lets you specify a date format (as defined in Java's SimpleDateFormat) that will be used to display all dates in HTML Forms. This will hold for entering new forms, and viewing/editing existing ones. (For example set the global property to "dd-MMM-yyyy" for an unambiguous date format like 31-Jan-2012.)

  • htmlformentry.showDateFormat: (added in HFE 1.9) set to true if you want static text for the date format to be displayed, else set to false. This text is displayed next to the date widgets as something like (dd/mm/yyyy)

  • htmlformentry.timeFormat: (added in HFE 2.6) lets you specify a time format (as defined in Java's SimpleDateFormat) that will be used to display all times in HTML Forms.  Default is 24-hour time (e.g. 18:41).  Setting this global property to "h:mm a" would change this to 6:41 PM.

Required Privileges

The following privileges may be necessary for various activities. It may be necessary to create them manually, and add them to your user's role.

  • [<=1.4] "Patient Dashboard - View Html Forms Section" <-- Required to view the HTML Forms tab on the patient dashboard
  • [>=1.5] "Form Entry" <-- Required to enter forms generally
  • "Add Encounters" <-- Required to submit a form

Upcoming features

To request more features, ask for them on or create them as tickets in our JIRA site.


Want to build an interface out of nothing but htmlforms? The HtmlFormFlowsheet module provides an easy way of combining html forms into a simple patient-dashboard-type configurable interface. Or, you can embed flowsheet tables directly into your existing htmlforms. This module is particularly useful if you are trying to model patient-based flowsheet type data (such as an MDRTB CAT-IV treatment card, or a chronic care flowsheet). See: the htmlformflowsheet module wiki.

  • No labels


  1. After creating a HTML form, I logged out and logged in with another account. The problem is I can edit this HTML form with new account. this sometimes may be lack of security because I think only the account creates a specified form will edit that form. So if having a setting which can choose  whether other accounts can edit forms or not is so great. 

    1. This is expected behavior in OpenMRS--forms can be edited by anyone with Edit Encounters privileges. The following feature is being worked on for 1.10: . If you're interested in forms that can only be edited by the user who entered them, you should suggest that under the "Vote on What We Do" link at the left.

      1. Thank you for your information :)

  2. This link says "access denied" when you click on it

     How to Embed HTML Form (generated by HTML Form Entry module) in a custom module

    Is there a new location for instructions ?