/ Published in: JavaScript
I have developed this applications based on my requirement for the projects you can change accordingly, as per you r specifications....
if anyone has any doubt please post it will send explanation for it
if anyone has any doubt please post it will send explanation for it
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!--By shashi--> <script language="javascript" src="valid.js"></script> <!--add into head part--> <body onLoad="e1(),calc1(),ov_sc(),avgcalc1(),avgtot(),crosscons(),totagg()"> <!--make sure on load does exist to fire deafult values--> <form name="ehsauditchklist" id="ehsauditchklist" action="?mode=ehsauditchklist" method="post" onSubmit="return check2();"> <input type="hidden" name="flag" value=""> <br/> <h4 align="center">Check List Selection </h4> <table class="" align="center" width="91%" border="0"> <tr> <td> </td> </tr> </table> <table class="bord" align="center" width="91%" border="1"> <tr> <th colspan="6" align="left"></th> </tr> <tr> <td align="right" colspan="6"><b></b></td> </tr> <form name="ehs_form" id="ehs_form" action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="plant_id" value="{$output_for_vill_plant[0][1]}"><!--get your values what ever needed for headings from the controller page and throw them to front end--> <table width="94%" align="center" border="0" > <tr> <td width="35%" align="left" ><img src="images/whlogo.gif" style="border:none" /></td> <td width="65%" align="left" valign="middle"><h2 align="left">EHS Audit Checklist Entry</h2></td> </tr> </table> <br/> <table width="78%" class="" align="center" border="0" style="border-top:none" bgcolor="#EBEBEB"> <tr > <td width="14%" height="" align="right"><div align="left"><strong>WHC Name</strong></div></td> <td width="32%">: <span id="plant_name_div"> <input type="text" name="who_name" id="whc_name" value="{$output_for_vill_plant[0][0]}" readonly /></span></td> <td width="26%" height=""align="right"><div align="left"><strong>Operator Name</strong></div></td> <td width="28%" height="">: <span id="mandal_name_div"> <input type="text" name="oper_name" id="oper_name" /></span></td> </tr> <tr > <td height=""align="right"><div align="left"><strong>Date</strong></div></td> <td height="">: <span id="mandal_name_div"><input type="text" name="from_dts1" readonly id="from_dts1" size="" value=""> <img src="images/cal.gif" border="0" valign="center" title='Click Here' alt='Click Here' onClick="scwShow(document.getElementById('from_dts1'),this);" /></span></td> <td height=""align="right"><div align="left"><strong>Quality Executive Name</strong></div></td> <td height="">: <span id="mandal_name_div"><input type="text" name="qua_ex_nam" id="qua_ex_nam" /></span></td> </tr> </table> <bR /> <table width="95%" class="bord" align="center" border="0" style="" frame="box" rules="none" cellpadding="0" cellspacing="0" bgcolor=""> <tr> <th width="4%">S.No</th> <th width="50%" align="center"> Parameter</th> <th width="7%">Impact</th> <th width="9%">Applicability</th> <th width="5%">Score</th> <th width="7%">Weighted Score</th> <th width="9%"> Remarks</th> </tr> <tr> <td bgcolor="#EBEBEB"> </td> <td colspan="9" align="left" bgcolor="#EBEBEB">ENVIRONMENTAL AND SOCIAL</td> </tr> <tr> <td width="4%">1.</td> <td width="50%">Clause1</td> <td width="7%">CR</td> <td width="9%"><select name="y_n_1" onChange="c1()">{html_options options=$y_n_arr}</select></td><!--same get the valeus from controller in your language repeat for the rest--> <td width="5%"><select name="sco_1" onChange="d1()">{html_options options=$dec_point}</select></td> <td width="7%"> <input type="text" name="wei_sco1" id="wei_sco1" value="" size="4" maxlength="4" onFocus="e1()" readonly /> </td> <td width="9%"><textarea name="rem_1" id="rem_1" cols="25" rows="2"></textarea></td> </tr> <tr> <td>2.</td> <td>Clause2</td> <td>CR</td> <td><select name="y_n_2" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_2" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco2" id="wei_sco2" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="rem_2" id="rem_2" cols="25" rows="2"></textarea></td> </tr> <tr> <td>3.</td> <td>Clause3</td> <td>MA</td> <td><select name="y_n_3" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_3" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco3" id="wei_sco3" value="" size="4" maxlength="4" onChange="e1()" readonly /></td> <td><textarea name="rem_3" id="rem_3" cols="25" rows="2"></textarea></td> </tr> <tr> <td>4.</td> <td>Clause4</td> <td>MI</td> <td><select name="y_n_4" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_4" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco4" id="wei_sco4" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="rem_4" id="rem_4" cols="25" rows="2"></textarea></td> </tr> <tr> <td>5.</td> <td>Clause5</td> <td>MI</td> <td><select name="y_n_5" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_5" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco5" id="wei_sco5" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="rem_5" id="rem_5" cols="25" rows="2"></textarea></td> </tr> <tr> <td bgcolor="#EBEBEB"> </td> <td colspan="9" align="left" bgcolor="#EBEBEB">HEALTH AND SAFETY</td> </tr> <tr> <td width="4%">6.</td> <td width="50%">Clause6</td> <td width="7%">CR</td> <td width="9%"><select name="y_n_6" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td width="5%"><select name="sco_6" onChange="d1()">{html_options options=$dec_point}</select></td> <td width="7%"> <input type="text" name="wei_sco6" id="wei_sco6" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td width="9%"><textarea name="rem_6" id="rem_6" cols="25" rows="2"></textarea></td> </tr> <tr> <td>7.</td> <td>Clause7</td> <td>CR</td> <td><select name="y_n_7" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_7" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco7" id="wei_sco7" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="rem_7" id="rem_7" cols="25" rows="2"></textarea></td> </tr> <tr> <td>8.</td> <td>Clause8</td> <td>CR</td> <td><select name="y_n_8" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_8" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco8" id="wei_sco8" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="rem_8" id="rem_9" cols="25" rows="2"></textarea></td> </tr> <tr> <td>9.</td> <td>Clause9</td> <td>CR</td> <td><select name="y_n_9" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_9" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco9" id="wei_sco9" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="rem_9" id="rem_9" cols="25" rows="2"></textarea></td> </tr> <tr> <td>10.</td> <td>Clause10</td> <td>MA</td> <td><select name="y_n_10" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_10" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco10" id="wei_sco10" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="rem_10" id="rem_10" cols="25" rows="2"></textarea></td> </tr> <tr> <td>11.</td> <td>Clause11</td> <td>MA</td> <td><select name="y_n_11" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_11" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco11" id="wei_sco11" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="rem_11" id="textarea11" cols="25" rows="2"></textarea></td> </tr> <tr> <td>12.</td> <td>Clause12</td> <td>MA</td> <td><select name="y_n_12" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_12" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco12" id="wei_sco12" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="rem_12" id="textarea11" cols="25" rows="2"></textarea></td> </tr> <tr> <td>13.</td> <td>Clause13</td> <td>MI</td> <td><select name="y_n_13" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_13" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco13" id="wei_sco13" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="textarea12" id="textarea12" cols="25" rows="2"></textarea></td> </tr> <tr> <td>14.</td> <td>Clause14</td> <td>MI</td> <td><select name="y_n_14" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_14" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco14" id="wei_sco14" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="textarea13" id="textarea13" cols="25" rows="2"></textarea></td> </tr> <tr> <td bgcolor="#EBEBEB"> </td> <td colspan="9" align="left" bgcolor="#EBEBEB">HOUSEKEEPING</td> </tr> <tr> <td>15.</td> <td>Clause15</td> <td>CR</td> <td><select name="y_n_15" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_15" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco15" id="wei_sco15" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="textarea14" id="textarea14" cols="25" rows="2"></textarea></td> </tr> <tr> <td>16.</td> <td>Clause16</td> <td>CR</td> <td><select name="y_n_16" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_16" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco16" id="wei_sco16" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="textarea15" id="textarea15" cols="25" rows="2"></textarea></td> </tr> <tr> <td>17.</td> <td>Clause17</td> <td>CR</td> <td><select name="y_n_17" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_17" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco17" id="wei_sco17" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="textarea16" id="textarea16" cols="25" rows="2"></textarea></td> </tr> <tr> <td>18.</td> <td>Clause18</td> <td>MA</td> <td><select name="y_n_18" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_18" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco18" id="wei_sco18" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="textarea17" id="textarea17" cols="25" rows="2"></textarea></td> </tr> <tr> <td>19.</td> <td>Clause19</td> <td>MA</td> <td><select name="y_n_19" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_19" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco19" id="wei_sco19" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="textarea18" id="textarea18" cols="25" rows="2"></textarea></td> </tr> <tr> <td bgcolor="#EBEBEB"> </td> <td colspan="9" align="left" bgcolor="#EBEBEB">RECORDS AND DOCUMENTS</td> </tr> <tr> <td>20.</td> <td>Clause20</td> <td>CR</td> <td><select name="y_n_20" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_20" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco20" id="wei_sco20" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="textarea19" id="textarea19" cols="25" rows="2"></textarea></td> </tr> <tr> <td>21.</td> <td>Clause21</td> <td>MI</td> <td><select name="y_n_21" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_21" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco21" id="wei_sco21" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="textarea20" id="textarea20" cols="25" rows="2"></textarea></td> </tr> <tr> <td>22.</td> <td>Clause22</td> <td>MI</td> <td><select name="y_n_22" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_22" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco22" id="wei_sco22" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="textarea21" id="textarea21" cols="25" rows="2"></textarea></td> </tr> <tr> <td>23.</td> <td>Clause23</td> <td>MI</td> <td><select name="y_n_23" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_23" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco23" id="wei_sco23" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="textarea22" id="textarea22" cols="25" rows="2"></textarea></td> </tr> <tr> <td>24.</td> <td>Clause24</td> <td>MI</td> <td><select name="y_n_24" onChange="c1()">{html_options options=$y_n_arr}</select></td> <td><select name="sco_24" onChange="d1()">{html_options options=$dec_point}</select></td> <td><input type="text" name="wei_sco24" id="wei_sco24" value="" size="4" maxlength="4" onFocus="e1()" readonly /></td> <td><textarea name="textarea23" id="textarea23" cols="25" rows="2"></textarea></td> </tr> </table> <br /> <table width="65%" class="bord" align="center" border="0" style="" frame="box" rules="none" cellpadding="0" cellspacing="0" bgcolor=""> <tr> <th width="29%" align="center">Scoring Parameters in Percentages</th> <th width="23%">EHS Score</th> <th width="23%">Max Applicable Score</th> <th width="23%">Percentage</th> </tr> <tr> <td>Environmental Score</td> <td><input type="text" name="es_score" id="es_score" maxlength="4" readonly onFocus="calc1()" /></td> <td><input type="text" name="es_max_score" id="es_max_score" maxlength="4" readonly onFocus="avgcalc1()" /></td> <td><input type="text" name="es_percent" id="es_percent" maxlength="4" readonly onFocus="crosscons()" /></td> </tr> <tr> <td>Healthy and Safety Score</td> <td><input type="text" name="hss_score" id="hss_score" maxlength="4" readonly onFocus="calc1()" /></td> <td><input type="text" name="hss_max_score" id="hss_max_score" maxlength="4" readonly onFocus="avgcalc1()" /></td> <td><input type="text" name="hss_percent" id="hss_percent" maxlength="4" readonly onFocus="crosscons()" /></td> </tr> <tr> <td>Housekeeping Score</td> <td><input type="text" name="hk_score" id="hk_score" maxlength="4" readonly onFocus="calc1()" /></td> <td><input type="text" name="hk_max_score" id="hk_max_score" maxlength="4" readonly onFocus="avgcalc1()" /></td> <td><input type="text" name="hk_percent" id="hk_percent" maxlength="4" readonly onFocus="crosscons()" /></td> </tr> <tr> <td>Reccords Score</td> <td><input type="text" name="rec_score" id="rec_score" maxlength="4" readonly onFocus="calc1()" /></td> <td><input type="text" name="rec_max_score" id="rec_max_score" maxlength="4" readonly onFocus="avgcalc1()"/></td> <td><input type="text" name="rec_percent" id="rec_percent" maxlength="4" readonly onFocus="crosscons()" /></td> </tr> <tr> <td>Overall Plant EHS Score</td> <td><input type="text" name="over_score" id="over_score" maxlength="4" readonly onFocus="ov_sc()" /></td> <td><input type="text" name="over_max_score" id="over_max_score" maxlength="4" readonly onFocus="avgtot()" /></td> <td><input type="text" name="over_percent" id="over_percent" maxlength="4" readonly onFocus="totagg()" /></td> </tr> </table> <table border="0" width="1000" > <tr> <td> </td> </tr> <tr> <td colspan="6" align="center"> <a href="#" onClick="checkmand();"><img src="images/Submit.jpg" style="border:none" /></a> </td> </tr> <tr> <td> </td> </tr> </table> <br /> </form> </body> <!--valid.js find it below--> // JavaScript Document function checkmand() { var d=document.ehs_form; if(d.oper_name.value=="") { alert('Please enter the operator name'); d.oper_name.focus(); return false; } else if(d.from_dts1.value=="") { alert('Please select the date'); d.from_dts1.focus(); return false; } else if(d.qua_ex_nam.value=="") { alert('Please enter the quality executive name'); d.qua_ex_nam.focus(); return false; } } function c1() { //alert('ckd'); var d=document.ehs_form; if(d.y_n_1.value=='N') { d.sco_1.value='0.00'; d.sco_1.disabled=true; d.wei_sco1.value='0.00'; } else { d.sco_1.disabled=false; } if(d.y_n_2.value=='N') { d.sco_2.value='0.00'; d.sco_2.disabled=true; d.wei_sco2.value='0.00'; } else { d.sco_2.disabled=false; } if(d.y_n_3.value=='N') { d.sco_3.value='0.00'; d.sco_3.disabled=true; d.wei_sco3.value='0.00'; } else { d.sco_3.disabled=false; } if(d.y_n_4.value=='N') { d.sco_4.value='0.00'; d.sco_4.disabled=true; d.wei_sco4.value='0.00'; } else { d.sco_4.disabled=false; } if(d.y_n_5.value=='N') { d.sco_5.value='0.00'; d.sco_5.disabled=true; d.wei_sco5.value='0.00'; } else { d.sco_5.disabled=false; } if(d.y_n_6.value=='N') { d.sco_6.value='0.00'; d.sco_6.disabled=true; d.wei_sco6.value='0.00'; } else { d.sco_6.disabled=false; } if(d.y_n_7.value=='N') { d.sco_7.value='0.00'; d.sco_7.disabled=true; d.wei_sco7.value='0.00'; } else { d.sco_7.disabled=false; } if(d.y_n_8.value=='N') { d.sco_8.value='0.00'; d.sco_8.disabled=true; d.wei_sco8.value='0.00'; } else { d.sco_8.disabled=false; } if(d.y_n_9.value=='N') { d.sco_9.value='0.00'; d.sco_9.disabled=true; d.wei_sco9.value='0.00'; } else { d.sco_9.disabled=false; } if(d.y_n_10.value=='N') { d.sco_10.value='0.00'; d.sco_10.disabled=true; d.wei_sco10.value='0.00'; } else { d.sco_10.disabled=false; } if(d.y_n_11.value=='N') { d.sco_11.value='0.00'; d.sco_11.disabled=true; d.wei_sco11.value='0.00'; } else { d.sco_11.disabled=false; } if(d.y_n_12.value=='N') { d.sco_12.value='0.00'; d.sco_12.disabled=true; d.wei_sco12.value='0.00'; } else { d.sco_12.disabled=false; } if(d.y_n_13.value=='N') { d.sco_13.value='0.00'; d.sco_13.disabled=true; d.wei_sco13.value='0.00'; } else { d.sco_13.disabled=false; } if(d.y_n_14.value=='N') { d.sco_14.value='0.00'; d.sco_14.disabled=true; d.wei_sco14.value='0.00'; } else { d.sco_14.disabled=false; } if(d.y_n_15.value=='N') { d.sco_15.value='0.00'; d.sco_15.disabled=true; d.wei_sco15.value='0.00'; } else { d.sco_15.disabled=false; } if(d.y_n_16.value=='N') { d.sco_16.value='0.00'; d.sco_16.disabled=true; d.wei_sco16.value='0.00'; } else { d.sco_16.disabled=false; } if(d.y_n_17.value=='N') { d.sco_17.value='0.00'; d.sco_17.disabled=true; d.wei_sco17.value='0.00'; } else { d.sco_17.disabled=false; } if(d.y_n_18.value=='N') { d.sco_18.value='0.00'; d.sco_18.disabled=true; d.wei_sco18.value='0.00'; } else { d.sco_18.disabled=false; } if(d.y_n_19.value=='N') { d.sco_19.value='0.00'; d.sco_19.disabled=true; d.wei_sco19.value='0.00'; } else { d.sco_19.disabled=false; } if(d.y_n_20.value=='N') { d.sco_20.value='0.00'; d.sco_20.disabled=true; d.wei_sco20.value='0.00'; } else { d.sco_20.disabled=false; } if(d.y_n_21.value=='N') { d.sco_21.value='0.00'; d.sco_21.disabled=true; d.wei_sco21.value='0.00'; } else { d.sco_21.disabled=false; } if(d.y_n_22.value=='N') { d.sco_22.value='0.00'; d.sco_22.disabled=true; d.wei_sco22.value='0.00'; } else { d.sco_22.disabled=false; } if(d.y_n_23.value=='N') { d.sco_23.value='0.00'; d.sco_23.disabled=true; d.wei_sco23.value='0.00'; } else { d.sco_23.disabled=false; } if(d.y_n_24.value=='N') { d.sco_24.value='0.00'; d.sco_24.disabled=true; d.wei_sco24.value='0.00'; } else { d.sco_24.disabled=false; } calc1(); ov_sc(); avgcalc1(); vgtot(); crosscons(); totagg(); } function e1() { var d=document.ehs_form; var a1=(d.sco_1.value * 1.00); var a2=(d.sco_2.value * 1.00); var a3=(d.sco_3.value * 0.50); var a4=(d.sco_4.value * 0.25); var a5=(d.sco_5.value * 0.25); var a6=(d.sco_6.value * 1.00); var a7=(d.sco_7.value * 1.00); var a8=(d.sco_8.value * 1.00); var a9=(d.sco_9.value * 1.00); var a10=(d.sco_10.value * 0.50); var a11=(d.sco_11.value * 0.50); var a12=(d.sco_12.value * 0.50); var a13=(d.sco_13.value * 0.25); var a14=(d.sco_14.value * 0.25); var a15=(d.sco_15.value * 1.00); var a16=(d.sco_16.value * 1.00); var a17=(d.sco_17.value * 1.00); var a18=(d.sco_18.value * 0.50); var a19=(d.sco_19.value * 0.50);var a20=(d.sco_20.value * 1.00); var a21=(d.sco_21.value * 0.25); var a22=(d.sco_22.value * 0.25); var a23=(d.sco_23.value * 0.25); var a24=(d.sco_24.value * 0.25); d.wei_sco1.value=a1.toFixed(2); d.wei_sco2.value=a2.toFixed(2); d.wei_sco3.value=a3.toFixed(2); d.wei_sco4.value=a4.toFixed(2); d.wei_sco5.value=a5.toFixed(2); d.wei_sco6.value=a6.toFixed(2); d.wei_sco7.value=a7.toFixed(2); d.wei_sco8.value=a8.toFixed(2); d.wei_sco9.value=a9.toFixed(2); d.wei_sco10.value=a10.toFixed(2); d.wei_sco11.value=a11.toFixed(2); d.wei_sco12.value=a12.toFixed(2); d.wei_sco13.value=a13.toFixed(2); d.wei_sco14.value=a14.toFixed(2); d.wei_sco15.value=a15.toFixed(2); d.wei_sco16.value=a16.toFixed(2); d.wei_sco17.value=a17.toFixed(2); d.wei_sco18.value=a18.toFixed(2); d.wei_sco19.value=a19.toFixed(2);d.wei_sco20.value=a20.toFixed(2); d.wei_sco21.value=a21.toFixed(2); d.wei_sco22.value=a22.toFixed(2); d.wei_sco23.value=a23.toFixed(2); d.wei_sco24.value=a24.toFixed(2); } function d1() { //alert('howhow'); var d=document.ehs_form; var a1=(d.sco_1.value * 1.00); var a2=(d.sco_2.value * 1.00); var a3=(d.sco_3.value * 0.50); var a4=(d.sco_4.value * 0.25); var a5=(d.sco_5.value * 0.25); var a6=(d.sco_6.value * 1.00); var a7=(d.sco_7.value * 1.00); var a8=(d.sco_8.value * 1.00); var a9=(d.sco_9.value * 1.00); var a10=(d.sco_10.value * 0.50); var a11=(d.sco_11.value * 0.50); var a12=(d.sco_12.value * 0.50); var a13=(d.sco_13.value * 0.25); var a14=(d.sco_14.value * 0.25); var a15=(d.sco_15.value * 1.00); var a16=(d.sco_16.value * 1.00); var a17=(d.sco_17.value * 1.00); var a18=(d.sco_18.value * 0.50); var a19=(d.sco_19.value * 0.50);var a20=(d.sco_20.value * 1.00); var a21=(d.sco_21.value * 0.25); var a22=(d.sco_22.value * 0.25); var a23=(d.sco_23.value * 0.25); var a24=(d.sco_24.value * 0.25); d.wei_sco1.value=a1.toFixed(2); d.wei_sco2.value=a2.toFixed(2); d.wei_sco3.value=a3.toFixed(2); d.wei_sco4.value=a4.toFixed(2); d.wei_sco5.value=a5.toFixed(2); d.wei_sco6.value=a6.toFixed(2); d.wei_sco7.value=a7.toFixed(2); d.wei_sco8.value=a8.toFixed(2); d.wei_sco9.value=a9.toFixed(2); d.wei_sco10.value=a10.toFixed(2); d.wei_sco11.value=a11.toFixed(2); d.wei_sco12.value=a12.toFixed(2); d.wei_sco13.value=a13.toFixed(2); d.wei_sco14.value=a14.toFixed(2); d.wei_sco15.value=a15.toFixed(2); d.wei_sco16.value=a16.toFixed(2); d.wei_sco17.value=a17.toFixed(2); d.wei_sco18.value=a18.toFixed(2); d.wei_sco19.value=a19.toFixed(2); d.wei_sco20.value=a20.toFixed(2); d.wei_sco21.value=a21.toFixed(2); d.wei_sco22.value=a22.toFixed(2); d.wei_sco23.value=a23.toFixed(2); d.wei_sco24.value=a24.toFixed(2); calc1(); crosscons(); totagg(); } function calc1() { var d=document.ehs_form; var b1=parseFloat(d.wei_sco1.value)+parseFloat(d.wei_sco2.value)+parseFloat(d.wei_sco3.value)+parseFloat(d.wei_sco4.value)+parseFloat(d.wei_sco5.value); var b2=parseFloat(d.wei_sco6.value)+parseFloat(d.wei_sco7.value)+parseFloat(d.wei_sco8.value)+parseFloat(d.wei_sco9.value)+parseFloat(d.wei_sco10.value)+parseFloat(d.wei_sco11.value)+parseFloat(d.wei_sco12.value)+parseFloat(d.wei_sco13.value)+parseFloat(d.wei_sco14.value); var b3=parseFloat(d.wei_sco15.value)+parseFloat(d.wei_sco16.value)+parseFloat(d.wei_sco17.value)+parseFloat(d.wei_sco18.value)+parseFloat(d.wei_sco19.value); var b4=parseFloat(d.wei_sco20.value)+parseFloat(d.wei_sco21.value)+parseFloat(d.wei_sco22.value)+parseFloat(d.wei_sco23.value)+parseFloat(d.wei_sco24.value); d.es_score.value=b1.toFixed(2); d.hss_score.value=b2.toFixed(2); d.hk_score.value=b3.toFixed(2); d.rec_score.value=b4.toFixed(2); ov_sc(); } function ov_sc() { var d=document.ehs_form; var f1=parseFloat(d.es_score.value)+parseFloat(d.hss_score.value)+parseFloat(d.hk_score.value)+parseFloat(d.rec_score.value); d.over_score.value=f1.toFixed(2); } function avgcalc1() { var d=document.ehs_form; if(d.y_n_1.value=='Y') { var c1='1.00'; //alert('a'); } else { var c1='0.00'; //alert('b'); } if(d.y_n_2.value=='Y') { var c2='1.00'; } else { var c2='0.00'; } if(d.y_n_3.value=='Y') { var c3='0.50'; } else { var c3='0.00'; } if(d.y_n_4.value=='Y') { var c4='0.25'; } else { var c4='0.00'; } if(d.y_n_5.value=='Y') { var c5='0.25'; } else { var c5='0.00'; } if(d.y_n_6.value=='Y') { var c6='1.00'; //alert('a'); } else { var c6='0.00'; //alert('b'); } if(d.y_n_7.value=='Y') { var c7='1.00'; } else { var c7='0.00'; } if(d.y_n_8.value=='Y') { var c8='1.00'; } else { var c8='0.00'; } if(d.y_n_9.value=='Y') { var c9='1.00'; } else { var c9='0.00'; } if(d.y_n_10.value=='Y') { var c10='0.50'; } else { var c10='0.00'; } if(d.y_n_11.value=='Y') { var c11='0.50'; } else { var c11='0.00'; } if(d.y_n_12.value=='Y') { var c12='0.50'; } else { var c12='0.00'; } if(d.y_n_13.value=='Y') { var c13='0.25'; } else { var c13='0.00'; } if(d.y_n_14.value=='Y') { var c14='0.25'; } else { var c14='0.00'; } if(d.y_n_15.value=='Y') { var c15='1.00'; //alert('a'); } else { var c15='0.00'; //alert('b'); } if(d.y_n_16.value=='Y') { var c16='1.00'; } else { var c16='0.00'; } if(d.y_n_17.value=='Y') { var c17='1.00'; } else { var c17='0.00'; } if(d.y_n_18.value=='Y') { var c18='0.50'; } else { var c18='0.00'; } if(d.y_n_19.value=='Y') { var c19='0.50'; } else { var c19='0.00'; } if(d.y_n_20.value=='Y') { var c20='1.00'; //alert('a'); } else { var c20='0.00'; //alert('b'); } if(d.y_n_21.value=='Y') { var c21='0.25'; } else { var c21='0.00'; } if(d.y_n_22.value=='Y') { var c22='0.25'; } else { var c22='0.00'; } if(d.y_n_23.value=='Y') { var c23='0.25'; } else { var c23='0.00'; } if(d.y_n_24.value=='Y') { var c24='0.25'; } else { var c24='0.00'; } var v1=parseFloat(c1)+parseFloat(c2)+parseFloat(c3)+parseFloat(c4)+parseFloat(c5); var v2=parseFloat(c6)+parseFloat(c7)+parseFloat(c8)+parseFloat(c9)+parseFloat(c10)+parseFloat(c11)+parseFloat(c12)+parseFloat(c13)+parseFloat(c14); var v3=parseFloat(c15)+parseFloat(c16)+parseFloat(c17)+parseFloat(c18)+parseFloat(c19); var v4=parseFloat(c20)+parseFloat(c21)+parseFloat(c22)+parseFloat(c23)+parseFloat(c24); d.es_max_score.value=v1.toFixed(2); d.hss_max_score.value=v2.toFixed(2); d.hk_max_score.value=v3.toFixed(2); d.rec_max_score.value=v4.toFixed(2); avgtot(); } function avgtot() { var d=document.ehs_form; var t1=parseFloat(d.es_max_score.value)+parseFloat(d.hss_max_score.value)+parseFloat(d.hk_max_score.value)+parseFloat(d.rec_max_score.value); d.over_max_score.value=t1.toFixed(2); } function crosscons() { var d=document.ehs_form; var intoval_a=(parseFloat(d.es_score.value)/parseFloat(d.es_max_score.value)); var divval_a=parseFloat(intoval_a)*100; // alert(d.es_score.value); var intoval_b=(parseFloat(d.hss_score.value)/parseFloat(d.hss_max_score.value)); var divval_b=parseFloat(intoval_b)*100; var intoval_c=(parseFloat(d.hk_score.value)/parseFloat(d.hk_max_score.value)); var divval_c=parseFloat(intoval_c)*100; var intoval_d=(parseFloat(d.rec_score.value)/parseFloat(d.rec_max_score.value)); var divval_d=parseFloat(intoval_d)*100; d.es_percent.value=divval_a.toFixed(2); d.hss_percent.value=divval_b.toFixed(2); d.hk_percent.value=divval_c.toFixed(2); d.rec_percent.value=divval_d.toFixed(2); } function totagg() { var d=document.ehs_form; var tot_a=parseFloat(d.es_percent.value)+parseFloat(d.hss_percent.value)+parseFloat(d.hk_percent.value)+parseFloat(d.rec_percent.value); var fin_tot=parseFloat(tot_a)/4; d.over_percent.value=fin_tot.toFixed(2); }