EMS Survey Form Demo

EMS Tagged Events
Interact with form example to see EMS tagging example
Form Example View source
Form Source View example
<form method="POST" onsubmit="ntptSubmitTag( this );">
	<label for="read-guide">I have read the
		<a href="http://ems.eos.nasa.gov/metrics/documents/public/TheEMSPageTagImplementationGuide.pdf">EMS Page Tag Implementation Guide</a>
	</label>
	<div id="read-guide">
		<input onchange="ntptEventTag( 'ev=readguide&readguide=' + encodeURIComponent( this.value ) );" type="radio" id="edit-readguide-yes" name="readguide" value="yes" />
		<label for="edit-readguide-yes">Yes</label>
		<input onchange="ntptEventTag( 'ev=readguide&readguide=' + encodeURIComponent( this.value ) );" type="radio" id="edit-readguide-no" name="readguide" value="no" />
		<label for="edit-readguide-no">No</label>
	</div>

	<label for="affiliation">Your metrics role is best described as:</label>
	<div id="affiliation">
		<input onchange="ntptEventTag( 'ev=role&role=' + encodeURIComponent( this.value ) );" type="radio" id="edit-affiliation-manager" name="affiliation" value="manager" />
		<label for="edit-affiliation-manager">manager</label>
		<input onchange="ntptEventTag( 'ev=role&role=' + encodeURIComponent( this.value ) );" type="radio" id="edit-affiliation-developer" name="affiliation" value="developer" />
		<label for="edit-affiliation-developer">developer</label>
		<input onchange="ntptEventTag( 'ev=role&role=' + encodeURIComponent( this.value ) );" type="radio" id="edit-affiliation-designer" name="affiliation" value="designer" />
		<label for="edit-affiliation-designer">designer</label>
		<input onchange="ntptEventTag( 'ev=role&role=' + encodeURIComponent( this.value ) );" type="radio" id="edit-affiliation-analyst" name="affiliation" value="analyst" />
		<label for="edit-affiliation-analyst">analyst</label>
		<input onchange="ntptEventTag( 'ev=role&role=' + encodeURIComponent( this.value ) );" type="radio" id="edit-affiliation-other" name="affiliation" value="other" />
		<label for="edit-affiliation-other">other</label>

		<label for="affiliation_other">Other</label>
		<input onchange="ntptEventTag( 'ev=roleInfo&roleInfo=' + encodeURIComponent( this.value ) );" type="text" id="affiliation_other" name="affiliation_other" value="" size="60" maxlength="128" />>
	</div>

	<label for="AOI">I wish to create the following custom reports: (check all desired)</label>
	<div id="AOI">
		<input onchange="ntptEventTag( 'ev=report&report=' + encodeURIComponent( this.value ) );" type="checkbox" id="edit-aoi-standard" name="AOI[standard]" value="standard" />
		<label for="edit-aoi-standard">standard</label>
		<input onchange="ntptEventTag( 'ev=report&report=' + encodeURIComponent( this.value ) );" type="checkbox" id="edit-aoi-scenario" name="AOI[scenario]" value="scenario" />
		<label for="edit-aoi-scenario">scenario (funnel)</label>
		<input onchange="ntptEventTag( 'ev=report&report=' + encodeURIComponent( this.value ) );" type="checkbox" id="edit-aoi-trend" name="AOI[trend]" value="trend" />
		<label for="edit-aoi-trend">trend</label>
		<input onchange="ntptEventTag( 'ev=report&report=' + encodeURIComponent( this.value ) );" type="checkbox" id="edit-aoi-dashboard" name="AOI[dashboard]" value="dashboard" />
		<label for="edit-aoi-dashboard">dashboard</label>
		<input onchange="ntptEventTag( 'ev=report&report=' + encodeURIComponent( this.value ) );" type="checkbox" id="edit-aoi-path-summary-between-pages" name="AOI[path summary between pages]" value="path summary between pages" />
		<label for="edit-aoi-path-summary-between-pages">path summary between pages</label>
		<input onchange="ntptEventTag( 'ev=report&report=' + encodeURIComponent( this.value ) );" type="checkbox" id="edit-aoi-other" name="AOI[other]" value="other" />
		<label for="edit-aoi-other">other:</label>

		<label for="AOI_other_value">Other</label>
		<input onchange="ntptEventTag( 'ev=otherreport&otherreport=' + encodeURIComponent( this.value ) );" type="text" id="AOI_other_value" name="AOI_other_value" value="" size="60" maxlength="128" />
	</div>

	<label for="nasaImpact">Describe what value metrics have at your center:</label>
	<textarea onchange="ntptEventTag( 'ev=value&value=' + encodeURIComponent( this.value ) );" id="nasaImpact" name="nasaImpact" cols="60" rows="5"></textarea>

	<input onclick="return validate();" type="submit" id="edit-submit" name="op" value="Submit" />
	<input type="submit" id="edit-skip" name="op" value="Skip" />

	<script type="text/javascript">
	function validate() {
		var message = [];
		if (!$('input[name="readguide"]:checked').length) {
			message[] = 'Please specify if you have read the EMS Page Tag Implementation Guide.';
		}
		if (!$('input[name="affiliation"]:checked').length) {
			message[] = 'Please specify a metrics role that describes you best.';
		}
		if (!$('#AOI input[type="checkbox"]:checked').length) {
			message[] = 'Please specify a reports type.';
		}
		if ($('textarea[name="nasaImpact"]').val().length > 2000) {
			message[] = 'Please enter less than 2000 characters in text box';
		}
		if (message.length > 0) {
			alert(message.join('\n'));
		}
		return message.length > 0;
	}
	</script>
</form>