Link to home
Start Free TrialLog in
Avatar of Pdesignz
PdesignzFlag for United States of America

asked on

Onclick event with button not working

Hello,

I have a form with a few divs that are show/hide. I have the event working with an image, but for some reason it won't work with an input button. What I would like is when input button is clicked that two divs are hidden and div displays, I am attaching code for review.

Thanks
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>General Document Inbox</title>
<script type="text/javascript">
	
 
function hide(id){
	document.getElementById(id).style.display='none';
}
function show(id){
	document.getElementById(id).style.display='';//'block'
}</script>
 
<style type="text/css">
<!--
#pageHeader { color: #FF9900; height: 18px; padding-top: 3px; padding-bottom: 3px; margin-top: 5px; margin-left: 15px; vertical-align: middle; text-align:left; font: bold 16px Arial, Helvetica, sans-serif; margin-bottom: 20px; }
#container ul { list-style: none; padding: 3px; margin: 0px; }
#container { font-family: Arial, Helvetica, sans-serif; width: 900px; }
#options { width: 750px; margin-right: auto; margin-left: auto; }
#scan #left { float: left; width: 500px; margin-left: 10px; border:solid 1px #e5e5e5; height: 320px; }
#scan #right { display: inline; float: left; width: 225px; margin-left: 10px; border:solid 1px #e5e5e5; height: 320px; }
#right table { width: 225px; }
#upload, #results { width: 750px; margin-right: auto; margin-left: auto; font-weight: bold; }
#scan { width: 750px; margin-right: auto; margin-left: auto; }
#container li { display: inline; margin-right: 25px; }
/*#textfield { font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #000000; height: 15px; border: 1px solid #6699CC; }*/
.dataHeader { font-weight: bold; color: #000000; line-height: 22px; text-indent: 2px; vertical-align: middle; text-align: left; background-color: #C3DEF9; padding: 1px; }
#upload table, #results table { font-weight: normal; width: 600px; }
 
-->
</style>
<link href="../HFPM_hybrid.css" rel="stylesheet" type="text/css" />
</head>
 
<body>
 
<div id="container">
<div id="pageHeader">General Document Inbox</div>
 
 
<form action="ehr_email.asp" method="post" enctype="multipart/form-data" name="form1" id="form1">
<div id="upload" style="display:;">
  <table cellspacing="1" cellpadding="1" style="margin-left:10px;">
  <tr>
    <td align="center" style="background-color:#C3DEF9"><input name="checkbox" type="checkbox" id="checkbox" /></td>
    <td class="dataHeader">File Name</td>
    <td class="dataHeader">Kind</td>
    <td class="dataHeader">Upload Date</td>
    <td width="75" class="dataHeader">Size</td>
    <td class="dataHeader">Options</td>
    </tr>
  <tr>
    <td align="center" class="datacell"><input type="checkbox" name="checkbox2" id="checkbox2" /></td>
    <td class="datacell">Family History Form - 00123</td>
    <td class="datacell">PATIENT FORM</td>
    <td class="datacell">04/28/2009</td>
    <td class="datacell">233 KB</td>
    <td class="datacell"><img src="../images/garbage.gif" width="14" height="14" /> <a href="javascript:;" onclick="hide('upload');show('options')"><img src="../images/editnew.gif" width="14" height="14" /></a></td>
    </tr>
  <tr>
    <td align="center" class="datacell2"><input type="checkbox" name="checkbox3" id="checkbox3" /></td>
    <td class="datacell2">LABCORP_06542335987</td>
    <td class="datacell2">LAB RESULT</td>
    <td class="datacell2">04/28/2009</td>
    <td class="datacell2">1.4 MB</td>
    <td class="datacell2"><img src="../images/garbage.gif" width="14" height="14" /> <img src="../images/editnew.gif" width="14" height="14" /></td>
    </tr>
  <tr>
    <td align="center" class="datacell"><input type="checkbox" name="checkbox4" id="checkbox4" /></td>
    <td class="datacell">Care Plan - Diabetes Type I</td>
    <td class="datacell">TEMPLATE</td>
    <td class="datacell">&nbsp;</td>
    <td class="datacell">186 KB</td>
    <td class="datacell"><img src="../images/garbage.gif" width="14" height="14" /> <img src="../images/editnew.gif" width="14" height="14" /></td>
    </tr>
  <tr>
    <td align="center" class="datacell2"><input type="checkbox" name="checkbox5" id="checkbox5" /></td>
    <td class="datacell2">Family History Form - 00124</td>
    <td class="datacell2">PATIENT FORM</td>
    <td class="datacell2">04/27/2009</td>
    <td class="datacell2">233 KB</td>
    <td class="datacell2"><img src="../images/garbage.gif" width="14" height="14" /> <img src="../images/editnew.gif" width="14" height="14" /></td>
    </tr>
  <tr>
    <td align="center" class="datacell"><input type="checkbox" name="checkbox6" id="checkbox6" /></td>
    <td class="datacell">HIPAA Consent - 006543</td>
    <td class="datacell">PATIENT FORM</td>
    <td class="datacell">04/27/2009</td>
    <td class="datacell">233 KB</td>
    <td class="datacell"><img src="../images/garbage.gif" width="14" height="14" /> <img src="../images/editnew.gif" width="14" height="14" /></td>
    </tr>
  <tr>
    <td align="center" class="datacell2"><input type="checkbox" name="checkbox7" id="checkbox7" /></td>
    <td class="datacell2">Family History Form - 00120</td>
    <td class="datacell2">PATIENT FORM</td>
    <td class="datacell2">04/26/2009</td>
    <td class="datacell2">233 KB</td>
    <td class="datacell2"><img src="../images/garbage.gif" width="14" height="14" /> <img src="../images/editnew.gif" width="14" height="14" /></td>
    </tr>
</table>
 
<div style="background-color:#e5e5e5; margin-top:25px;">
    <div style="margin-left:auto; margin-right:auto; width:140px; padding-top:10px; padding-bottom:10px;">
      <input name="button" type="button" class="frmButton" id="button" value="Save" />
       <input name="button4" type="button" class="frmButton" id="button4" value="Cancel" onclick="javascript:window.close();" />
    </div>
  </div>
  </div>
  
  <div id="results" style="display:none;">
  <table cellspacing="1" cellpadding="1" style="margin-left:10px;">
  <tr>
    <td align="center" style="background-color:#C3DEF9"><input name="checkbox" type="checkbox" id="checkbox" /></td>
    <td class="dataHeader">File Name</td>
    <td class="dataHeader">Kind</td>
    <td class="dataHeader">Upload Date</td>
    <td width="75" class="dataHeader">Size</td>
    <td class="dataHeader">Options</td>
    </tr>
  <tr>
    <td align="center" class="datacell2"><input type="checkbox" name="checkbox3" id="checkbox3" /></td>
    <td class="datacell2">LABCORP_06542335987</td>
    <td class="datacell2">LAB RESULT</td>
    <td class="datacell2">04/28/2009</td>
    <td class="datacell2">1.4 MB</td>
    <td class="datacell2"><img src="../images/garbage.gif" width="14" height="14" /> <img src="../images/editnew.gif" width="14" height="14" /></td>
    </tr>
  <tr>
    <td align="center" class="datacell"><input type="checkbox" name="checkbox4" id="checkbox4" /></td>
    <td class="datacell">Care Plan - Diabetes Type I</td>
    <td class="datacell">TEMPLATE</td>
    <td class="datacell">&nbsp;</td>
    <td class="datacell">186 KB</td>
    <td class="datacell"><img src="../images/garbage.gif" width="14" height="14" /> <img src="../images/editnew.gif" width="14" height="14" /></td>
    </tr>
  <tr>
    <td align="center" class="datacell2"><input type="checkbox" name="checkbox5" id="checkbox5" /></td>
    <td class="datacell2">Family History Form - 00124</td>
    <td class="datacell2">PATIENT FORM</td>
    <td class="datacell2">04/27/2009</td>
    <td class="datacell2">233 KB</td>
    <td class="datacell2"><img src="../images/garbage.gif" width="14" height="14" /> <img src="../images/editnew.gif" width="14" height="14" /></td>
    </tr>
  <tr>
    <td align="center" class="datacell"><input type="checkbox" name="checkbox6" id="checkbox6" /></td>
    <td class="datacell">HIPAA Consent - 006543</td>
    <td class="datacell">PATIENT FORM</td>
    <td class="datacell">04/27/2009</td>
    <td class="datacell">233 KB</td>
    <td class="datacell"><img src="../images/garbage.gif" width="14" height="14" /> <img src="../images/editnew.gif" width="14" height="14" /></td>
    </tr>
  <tr>
    <td align="center" class="datacell2"><input type="checkbox" name="checkbox7" id="checkbox7" /></td>
    <td class="datacell2">Family History Form - 00120</td>
    <td class="datacell2">PATIENT FORM</td>
    <td class="datacell2">04/26/2009</td>
    <td class="datacell2">233 KB</td>
    <td class="datacell2"><img src="../images/garbage.gif" width="14" height="14" /> <img src="../images/editnew.gif" width="14" height="14" /></td>
    </tr>
</table>
 
<div style="background-color:#e5e5e5; margin-top:25px;">
    <div style="margin-left:auto; margin-right:auto; width:140px; padding-top:10px; padding-bottom:10px;">
    <input name="button3" type="button" class="frmButton" id="button3" value="Save" onclick="hide('upload');hide('options');show('results')" />
    <input name="button4" type="button" class="frmButton" id="button4" value="Cancel" onclick="javascript:window.close();" />
    </div>
  </div>
 
  </div>
  
<div id="options" style="display:none;">
  <table cellpadding="1" cellspacing="1" style="width:450px; margin-left:10px;">
  <tr>
    <td class="formlabel">File Name</td>
    <td class="datacell"><input name="textfield" type="text" id="textfield" style="width:250px;" value="Family History Form - 00123" /></td>
  </tr>
  <tr>
    <td class="formlabel">Document Type</td>
    <td><select name="select" id="select" style="width:200px;">
      <option>Patient Form</option>
    </select>    </td>
  </tr>
  <tr>
    <td class="formlabel">Title</td>
    <td><input name="textfield2" type="text" class="formfield" id="textfield2" style="width:250px;" value="Family History Form" /></td>
  </tr>
  <tr>
    <td class="formlabel">Document Date</td>
    <td><input name="textfield3" type="text" class="formfield" id="textfield3" style="width:65px;" value="04/28/2009" maxlength="10" />
      <img src="../images/icon_calendar.png" width="18" height="16" /></td>
  </tr>
  <tr>
    <td class="formlabel">Provider</td>
    <td><select name="select2" id="select2" style="width:200px;">
      <option>NO REVIEW REQUIRED</option>
      <option selected="selected">JOHNSON, JACK</option>
      <option>SMITH, MIKE</option>
    </select>    </td>
  </tr>
  <tr>
    <td class="formlabel">Review Required</td>
    <td><input name="review" type="radio" id="radio3" value="Yes" checked="checked" />
      Yes
        <input type="radio" name="review" id="radio4" value="No" />
        No</td>
  </tr>
  <tr>
    <td class="formlabel">Patient</td>
    <td><input name="textfield4" type="text" id="textfield4" style="width:200px;" value="Smith, John" /></td>
  </tr>
  <tr>
    <td class="formlabel">Encounter</td>
    <td><select name="select3" id="select3" style="width:150px;">
      <option>enc03252009-0005</option>
    </select>
    </td>
  </tr>
  <tr>
    <td class="formlabel"><strong>Encounter Level 1</strong></td>
    <td><select name="select4" id="select4" style="width:150px;">
      <option>Physical Exam</option>
    </select>
    </td>
  </tr>
  <tr>
    <td class="formlabel"><strong>Encounter Level2</strong></td>
    <td><select name="select5" id="select5" style="width:150px;">
      <option>Cardiovascular</option>
    </select>
    </td>
  </tr>
</table>
<div style="background-color:#e5e5e5; margin-top:25px;">
    <div style="margin-left:auto; margin-right:auto; width:150px; padding-top:10px; padding-bottom:10px;">
    <input name="button3" type="button" class="frmButton" id="button3" value="Save" />
    <input name="button4" type="button" class="frmButton" id="button4" value="Cancel" onclick="javascript:window.close();" />
    </div>
  </div>
</div>
</form>
</div>
</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Member_2_4913559
Member_2_4913559
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Pdesignz

ASKER

Thanks, I was able to figure it out... I was looking in the wrong div!!