Personal tools
You are here: Home / OSCAR EMR 12.x / 2.0 Clinical Functions / 2.5 eForms / 2.5.5 Finishing it up signature stamp, checkbox sizing and more

2.5.5 Finishing it up signature stamp, checkbox sizing and more

How to incorporate the electronic equivalent of your signature stamp in an eForm, control checkbox size and more

Finishing it up

The eForm opens up a large range of possibilities to introduce functionality that extends the basic form.  Below are several examples that users have found to add utility or change appearance of the eForms that are used.


If you have need of a signed eForm (say for faxing from the computer)  and you can't browbeat the agency to accept "digitally authenticated" nonsense that the specialists like to use, you can contain scanned signatures within each form.  This merely replaces the signature stamp that your MOA might apply to a paper form.  This I would point out, does not fulfill the requirements of an "original signature", for that see technique 3.

Technique 1

This following technique is expandable to any number of signed versions of a form.  This technique is more involved but allows the end user to pick the signature, and the signature can overlap form elements (very useful for busy forms)

1) Say you have a scanned mammography form "mammo.png". Scan a signed copy at the same settings (Or just add the image of your signature to the blank with image editing software such as the Gimp) to form mammoPHC.png for Peter's signed form, mammoNNN.png for Nancy's signed form etc

2) add javascript in the head of the form to reference the series of forms in an array

<script type="text/javascript">

var ImgArray = [

function ChangeImg(imgPtr) {
     document.getElementById('CommonImg').src = ImgArray[imgPtr];


3) Ensure that the background image has an id.  You can use any id you like, but it should be unique and the id in the script and image should match. For the example I gave the image in the form would be referenced as below with an id of CommonImg
<img id="CommonImg" src="${oscar_image_path}mammo.png" 
 style="position: absolute; left: 0px; top: 0px; width:750">

3) add check boxs at the bottom of the form in the no print area for the user to choose from.
<br><input type="radio" name="imgControl1" id="0" value="0" onclick="ChangeImg(this.value)" > plain form
<input type="radio" name="imgControl1" id="1" value="1" onfocus="ChangeImg(this.value)" > Signed PHC
<input type="radio" name="imgControl1" id="1" value="2" onfocus="ChangeImg(this.value)" > Signed NNN

Technique 2

An alternate approach is to layer the image of the signature on the form.  This technique has the advantage that its more portable as you can reuse the code.  Its  only disadvantages are that if there is any form element (eg checkbox) that is overlapped by the rectangle of the signature image, then you will not be able to access it, and you are stuck using the signature that it offers you.

1) Scan copies of the signatures that you will use and save them with transparent backgrounds PHC.png for Peter and so on.  Name a transparent image (it can be a single pixel) BNK.png

2) Add Javascript to check against the patients physician which signature file should be used (match the indexOf to the particular names of the doctors in your case)

<body Onload="SignForm(); ">

<input type="hidden" name="physician" id="physician" oscarDB=doctor >

<script type="text/javascript">
function SignForm(){
       if (document.getElementById('physician').value.indexOf('zapski')>0){
               document.getElementById("signature").src = "${oscar_image_path}PHC.png";
       else if(document.getElementById('physician').value.indexOf('dermott')>0){
               document.getElementById("signature").src = "${oscar_image_path}TMD.png";
       else if(document.getElementById('physician').value.indexOf('urman')>0){
               document.getElementById("signature").src = "${oscar_image_path}MCH.png";
       else {
               document.getElementById("signature").src = "${oscar_image_path}BNK.png";

3) The second piece is a reference to the transparent blank file as a placeholder for the signature at a given position on the form where you want the signature to appear.

<div style="position: absolute; left: 80px; top: 940px; z-index:2;">
<img id="signature" src="${oscar_image_path}BNK.png" width="260" height ="40">

Technique 3

Sometimes you just need an original signature.  This can be provided by the use of a tablet device  (eg one made by Topaz) to capture the signature and the drawing eForm.   This is the simplest approach. Just use your form for the background of one of the graphical forms on the Oscar User Society webpage.  The only design disadvantage is that you cannot easily overlap the drawing area with the areas that have form elements (buttons, text areas, check boxes and the like)  and retain access to the elements, so be sure to size the drawing area accordingly.  

Checkbox Sizing

 Forms need large clear check boxes.  You can make check boxes larger by assigning them to a class with a style sheet indicated as below.  1.3x for the screen and 1.8 for printing works well with Firefox 3.5 on Windows systems, your mileage may vary.


<style type="Text/css">
input.largerCheckbox {
	-moz-transform:scale(1.3);         /*scale up image 1.3x - Firefox specific */
	-webkit-transform:scale(1.3);      /*Webkit based browser eg Chrome, Safari */
	-o-transform:scale(1.3);           /*Opera browser */
<style type="text/css" media="print">
input.largerCheckbox {
	-moz-transform:scale(1.8);         /*scale up image 1.8x - Firefox specific */
	-webkit-transform:scale(1.3);      /*Webkit based browser eg Chrome, Safari */
	-o-transform:scale(1.3);           /*Opera browser */
<!--[if IE]>
 <style type="text/css">
 input.largerCheckbox {
	height: 30px;                     /*30px checkboxes for IE 5 to IE 7 */
	width: 30px;


For the body of the eForm ensure that all checkboxes are marked for the largerCheckbox class.

<form action="./">

<input type="checkbox" class="largerCheckbox" name="checkBox">


This code works on

  • Firefox 3.5 or newer
  • Safari (or similar WebKit)  3.1 or newer
  • IE 5-7 or IE 8 running compatibility mode
  • Opera 10.5

Blackbox Technique

You can make any text form element act like a checkbox that toggles black or shite if you click on it or enter a key on the keyboard when it has focus.

<!--  paste the following into your eForm at the head of the html -->

<!--  blackbox style -->
<style type="text/css">
.BlackBox {
	font-size: 14px;
<script src=""></script>

<!--  blackbox event handler -->
<script type="text/javascript">
$(document).ready(function() {
	$( ".BlackBox" ).click(function() {
		var bc = $( this ).css( "background-color" );
		if (bc=="rgb(0, 0, 0)") {
			$( this ).css( "background-color", "white" );
			$( this ).val('');
		} else {
			$( this ).css( "background-color", "rgb(0, 0, 0)" );
			$( this ).val('X'); //webkit fudge as it doesn't print background
	$( ".BlackBox" ).keypress(function(event) {
		// any key press except tab will constitute a value change to the blackbox
		if (event.which != 0){
			$( this ).click();
			return false;
<!--  end blackbox code -->
<body  width="750px" >
<form method="post" action="" name="Resp" id="Resp" >

<!--  in the eForm anything you put in the BlackBox class will toggle colours without additional coding -->
<div style="position:absolute; left:10px; top:10px;">
Click or Enter a Key over a box to turn any of them black
<input name="X3" id="X3" type="text" class="BlackBox" value="">
<input name="X5" id="X5" type="text" class="BlackBox" style="position:absolute; left:142px; top:69px; width:60px; height:60px; " value="">
<input name="X7" id="X7" type="text" class="BlackBox"style="position:absolute; left:255px; top:243px; width:12px; height:12px; " value="">



The above code works both on the desktop and on your OSCAR server



Document Actions