HTML form - usage of "when" tag issue

I’m using openmrs standalone 2.6.1 on a mac and would like to use the “when” tag but it does not seem to respond as described. In the following if I select 1066/1067 the div is still visible. Any help is appreciated. Following is the html form:

paperFormId = (Fill this in) headerColor =#009d8e fontOnHeaderColor = white
	.section {
		border: 1px solid $headerColor;
		padding: 2px;
		text-align: left;
		margin-bottom: 1em;
	.sectionHeader {
		background-color: $headerColor;
		color: $fontOnHeaderColor;
		display: block;
		padding: 2px;
		font-weight: bold;
	table.baseline-aligned td {
		vertical-align: baseline;

<span style="float:right">Paper Form ID: $paperFormId</span>
<h2>sample (v1)</h2>

<section headerLabel="1. Encounter Details">
	<table class="baseline-aligned">
			<td><encounterDate default="today"/></td>
			<td><encounterLocation default="SessionAttribute:emrContext.sessionLocationId"/></td>
			<td><encounterProvider default="currentUser"/></td>

<section headerLabel="2. Sample Obs">

    <obs id="testObsId" conceptId="48"  labelText="Miscarriage?" answerConceptIds="1065,1066,1067">
            <when value="1065"
<div id="form-signed-role-other">
    <obs conceptId="5089"/>


Do you get any errors on the JavaScript console?

There are no errors in the javascript console. I just created the form in my post on the demo site. The form is titled “testwhen”. You can see there are no errors and nothing happens when the “Miscarriage?” selector is selected.

Which url are you using to access the form?

Am looking at this text: The htmlformentryui module has pages "htmlform/enterHtmlFormWithSimpleUi" and "htmlform/editHtmlFormWithSimpleUi" which include all the JavaScript and CSS for the simple UI


I was following the HTML Form Entry Module HTML Reference at<when>

What i mean is that, which application url are you accessing the form with?

I just added the form to the demo site, made it available, browsed to the patient dashboard and attempted to use the form, as below…does this clarify my process so it can be diagnosed? image

What url do you have in the browser?

I hope the following provides the browser url you’re requesting.

The url for html form creation is:

The url for entering encounter data is:

Did you get a chance to look at this?

Here is an example of your form:

As a summary of the simple form ui documentation, these are the changes needed on your form:

  1. On this screen, the Diplay Style should be Simple:

  2. The div tag should be replaced with the p tag and put inside a fieldset tag

  3. Your section tag should have this attribute: sectionTag=“section”

This is how your form definition should eventually look like:

@dkayiwa, many thanks!!