วันพฤหัสบดีที่ 8 พฤศจิกายน พ.ศ. 2555

Sim_water_flood1


<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<form name="frmMain" action="" method="post">
<script language="JavaScript">
function fncSum()
{
if(isNaN(document.frmMain.now_mcm.value) || document.frmMain.now_mcm.value == "")
{
alert('(Number A)Please input Number only.');
document.frmMain.now_mcm.focus();
return;
}

if(isNaN(document.frmMain.now_hr.value) || document.frmMain.now_hr.value == "")
{
alert('(Number B)Please input Number only.');
document.frmMain.now_hr.focus();
return;
}
if(isNaN(document.frmMain.sim_mcm.value) || document.frmMain.sim_mcm.value == "")
{
alert('(Number A)Please input Number only.');
document.frmMain.sim_mcm.focus();
return;
}

if(isNaN(document.frmMain.sim_hr.value) || document.frmMain.sim_hr.value == "")
{
alert('(Number B)Please input Number only.');
document.frmMain.sim_hr.focus();
return;
}
var result = parseFloat(document.frmMain.now_mcm.value) / parseFloat(document.frmMain.now_hr.value) *3600;
document.frmMain.now_cms.value = result.toFixed(2);
var result1 = parseFloat(document.frmMain.sim_mcm.value) / parseFloat(document.frmMain.sim_hr.value) *3600;
document.frmMain.sim_cms.value = result1.toFixed(2);
document.frmMain.d_sim_mcm.value  = parseFloat(document.frmMain.now_mcm.value) - parseFloat(document.frmMain.sim_mcm.value);
document.frmMain.d_sim_hr.value  = parseFloat(document.frmMain.now_hr.value) - parseFloat(document.frmMain.sim_hr.value);
document.frmMain.d_sim_cms.value  = parseFloat(document.frmMain.now_cms.value) - parseFloat(document.frmMain.sim_cms.value);
}
</script>
<table width="365" border="1">
  <tr>
    <td width="41">&nbsp;</td>
    <td width="60"><div align="center">น้ำระบาย</div></td>
    <td width="60"><div align="center">ชม. ระบาย </div></td>
    <td width="60"><div align="center">cms.</div></td>
    <td width="110">Set Time </td>
  </tr>
  <tr>
    <td>Now</td>
    <td><div align="center">
      <input name="now_mcm" type="text" id="now_mcm"  value="0" size="10" onChange="fncSum();">
    </div></td>
    <td><div align="center">
      <input name="now_hr" type="text" id="now_hr" value="0" size="10" onChange="fncSum();">
    </div></td>
    <td><div align="center">
      <input name="now_cms" type="text" id="now_cms" value="0" size="10" readonly="true">
    </div></td>
    <td><input name="auto" type="button" id="auto" value="Auto" onclick="document.frmMain.simtime.disabled=true">
      <input name="manual" type="button" id="manual" onclick="document.frmMain.simtime.disabled=false" value="MAN"></td>
  </tr>
  <tr>
    <td>Sim</td>
    <td><div align="center">
        <input name="sim_mcm" type="text" id="sim_mcm"  value="0" size="10" onChange="fncSum();">
    </div></td>
    <td><div align="center">
        <input name="sim_hr" type="text" id="sim_hr" value="0" size="10" onChange="fncSum();">
    </div></td>
    <td><div align="center">
        <input name="sim_cms" type="text" id="sim_cms" value="0" size="10" readonly="true">
    </div></td>
    <td><div align="center">
      <input name="simtime" type="text" value="01:00" size="10" disabled="disabled">
    </div></td>
  </tr>
  <tr>
    <td>D.sim</td>
    <td><div align="center">
        <input name="d_sim_mcm" type="text" id="d_sim_mcm" value="0" size="10">
    </div></td>
    <td><div align="center">
        <input name="d_sim_hr" type="text" id="d_sim_hr" value="0" size="10">
    </div></td>
    <td><div align="center">
        <input name="d_sim_cms" type="text" id="d_sim_cms" value="0" size="10" readonly="true">
    </div></td>
    <td>&nbsp;</td>
  </tr>
</table>
<br>
<br>
<br>
</form>
</body>
</html>
http://www.dailymotion.com/video/xuw7pk_y-yy-yyyyy-y-yyy-yy-yy-yyy-1_shortfilms?start=21

ไม่มีความคิดเห็น:

แสดงความคิดเห็น