|
|
|
่่ขอโค๊ด javascript กรอกช่องแรก คำนวน vat7 และยอดรวม |
|
|
|
|
|
|
|
Code (JavaScript)
var total;
var vat ;
vat = (parseInt(document.form1.text1.value)*7)/100;
total = parseInt(document.form1.text1.value)+vat;
document.form1.text2.value = vat;
document.form1.text3.value = total;
|
ประวัติการแก้ไข 2016-08-18 16:02:35
|
|
|
|
Date :
2016-08-18 16:01:59 |
By :
mee079 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function(e) {
$('#Price').on('keyup',function(){
$('#Vat').val('');
$('#Net').val('');
if($(this).val() != ''){
$('#Vat').val($(this).val()*7/100);
$('#Net').val($(this).val()+($(this).val()*7/100));
}
});
});
</script>
<input type="number" id="Price" placeholder="Price" /></br>
<input type="number" id="Vat" placeholder="Vat" /></br>
<input type="number" id="Net" disabled="disabled" />
|
ประวัติการแก้ไข 2016-08-18 17:23:44
|
|
|
|
Date :
2016-08-18 16:13:43 |
By :
dudesaranyu |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้แล้ว คับ มั่วเอา ขอบคุณ ครับ +1
Code (Java)
<script language="JavaScript">
function fncSum()
{
var val1 = parseFloat(document.getElementById("tax_money").value) * 0.07 ;
document.form.tax_all_money.value = parseFloat(document.form.tax_money.value) * 0.07 ;
document.form.tax_money_vat.value = parseFloat(document.form.tax_money.value) + val1;
}
</script>
<input name="tax_money" type="text" id="tax_money" size="15" OnChange="fncSum();" style="text-align:right" autocomplete="off"/>
<input name="tax_all_money" type="text" id="tax_all_money" value="" size="15" style="text-align:right" OnChange="fncSum();"/>
<input name="tax_money_vat" type="text" id="tax_money_vat" size="15" OnChange="fncSum();" style="text-align:right" autocomplete="off"/>
|
ประวัติการแก้ไข 2016-08-19 10:30:38
|
|
|
|
Date :
2016-08-19 10:26:45 |
By :
rock_rock |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|