Mengeluarkan hasil secara otomatis

willy santoso · Jul 2, 2014
Mohon dibantu gan script saya,

kondisinya pada waktu saya input total transaksi, point akan muncul dengan sendirinya

total transaksi / 300000
Thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Entry Customer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="simpan-data-crm.php" method="post" enctype="multipart/form-data" name="FMHS">
<table width="452" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#669900">
<tr>
<td height="40" align="center" bgcolor="#669900"><strong><font color="#FFFFFF">ENTRY DATA CUSTOMER</font></strong></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><table width="452" border="0" align="center" cellpadding="5" cellspacing="0">
<tr><td width="113">Member ID</td><td width="11">:</td>
<td width="237"><input name="member_id" type="text" id="member_id" size="12" maxlength="12"></td>
</tr>
<tr><td>Name</td><td>:</td>
<td><input name="member_name" type="text" id="member_name" size="30" maxlength="30"></td>
</tr>
<tr><td>Gender</td><td>:</td>
<td><input name="gender" type="radio" value="M" checked> Male<input name="gender" type="radio" value="F"> Female </td>
</tr>
<tr><td>DOB</td><td>:</td>
<td><select name="date" size="1" id="date">
<?php
for ($i=1;$i<=31;$i++)
{
echo "<option value=".$i.">".$i."</option>";
}
?>
</select>
<select name="month" size="1" id="month">
<?php
$month=array("","January","February","March","April","May","June","July","August","September","October","November","December");
for ($i=1;$i<=12;$i++)
{
echo "<option value=".$i.">".$month[$i]."</option>";
}
?>
</select>
<select name="year" size="1" id="year">
<?php
for ($i=1970;$i<=2050;$i++)
{
echo "<option value=".$i.">".$i."</option>";
}
?>
</select></td>
</tr>
<tr>
<td>Address</td><td>:</td>
<td><textarea name="address" cols="30" rows="3" id="address"></textarea></td>
</tr>
<tr><td>Mobile Phone</td><td>:</td>
<td><input name="mobile_phone" type="text" id="mobile_phone" size="30" maxlength="30"></td>
</tr>
<tr><td>Home Phone</td><td>:</td>
<td><input name="home_phone" type="text" id="home_phone" size="30" maxlength="30"></td>
</tr>
<tr><td>Store</td><td>:</td>
<td><input name="store" type="text" id="store" size="12" maxlength="15"></td>
</tr>
<tr><td>City</td><td>:</td>
<td><input name="city" type="text" id="city" size="12" maxlength="15"></td>
</tr>
<tr><td>Area</td><td>:</td>
<td><input name="area" type="text" id="area" size="12" maxlength="10"></td>
</tr>
<tr><td>Member Type</td><td>:</td>
<td><input name="member_type" type="radio" value="T" checked> Temporary<input name="member_type" type="radio" value="P"> Permanent </td>
</tr>
<tr><td>Date Joined</td><td>:</td>
<td><input name="date_joined" type="text" id="date_joined" size="12" maxlength="15"></td>
</tr>
<tr><td>Transaction</td><td>:</td>
<td><input name="total_transaction" type="text" id="total_transaction" onKeyUp='hitung()' size="15" maxlength="15"></td>
</tr>
<tr><td>Point</td><td>:</td>
<td><input name="point" type="text" id="point" readonly="point" size="15" maxlength="15"></td>
</tr>
<tr><td colspan="3" align="center"><input name="fok" type="submit" id="fok" value="Save">
<input name="fulang" type="reset" id="fulang" value="Reset">
<input name="fulang2" type="button" id="fulang2" value="Cancel" onClick="javascript:history.back()"></td>
</tr>
</table></td>
</tr>
</table>
</form>
<div align="center"><a href="index.php">Menu Utama</a></div>
</body>
</html>
Silahkan login untuk menjawab!
0
Loading...
Ellyx Christian · Jul 4, 2014 · 0 Suka · 0 Tidak Suka
tambahkan javascript seperti:
<script type="text/javascript">
function hitung(){
	var totalTransaksi = parseFloat(document.getElementById('total_transaction').value);
	document.getElementById('point').value = (totalTransaksi / 300000);
}
</script>