خرید بک لینک

What is the simplest way of making input field show zero before data input? Is there any other more simple way of making what below code shows?

<form id="vat_form" class="form-horizontal alert alert-info alert-block" accept-charset="UTF-8" method="post" data-remote="true">
<div style="margin: 0; padding: 0; display: inline;"><input name="utf8" type="hidden" value="✓" /></div>
<input id="pressed" name="pressed" type="hidden" value="amount_wo_vat" />

<div class="control-group big_field"><label class="control-label bold_text">Nuomos sutarties suma:</label>
<div class="controls"><input id="suma" class="text-right input-large" name="suma" type="text" value="0" /></div>
</div>

<div class="control-group big_field"><label class="control-label bold_text">Gaunamos pajamos ("i rankas"):</label>
<div class="controls"><input id="pajamos" class="text-right input-large" name="pajamos" type="text" value="0" /></div>
</div>

<div class="control-group big_field"><label class="control-label">Pajamu mokestis 15%:</label>
<div class="controls"><input id="mokestis" class="text-right input-large" disabled="disabled" name="mokestis" type="text" value="0" /></div>
</div>

<div class="control-group big_field"><label class="control-label">Privalomas sveikatos draudimas 0%:</label>    
<div class="controls"><input    id="draudimas" class="text-right input-large" disabled="disabled" name="draudimas" type="text" value="0" /></div>
</div>



<script>// <![CDATA[
    var suma = document.getElementById("suma");
    var pajamos = document.getElementById("pajamos");
    var mokestis = document.getElementById("mokestis");
suma.onclick = function() {
suma.value = "";
}
pajamos.onclick = function() {
pajamos.value = "";
}
    suma.onkeyup = function () {
        pajamos.value = ((suma.value*10000000000000)/11764705882353).toFixed(2);
       mokestis.value = (suma.value*0.15).toFixed(2);
if (pajamos.value % 1 === 0) {
            pajamos.value = Math.round(pajamos.value).toFixed(0);
        };
if (mokestis.value % 1 === 0) {
            mokestis.value = Math.round(mokestis.value).toFixed(0);
        };
    };
    pajamos.onkeyup = function () {
        suma.value = (pajamos.value*(11764705882353/10000000000000)).toFixed(2);
       mokestis.value = (suma.value*0.15).toFixed(2);
if (suma.value % 1 === 0) {
            suma.value = Math.round(suma.value).toFixed(0);
        };
if (mokestis.value % 1 === 0) {
            mokestis.value = Math.round(mokestis.value).toFixed(0);
        };
    };
// ]]></script>
</form>

- - , .

برچسب: نویسنده: استخدام کار تاريخ: جمعه 30 بهمن 1394 ساعت: 1:18

صفحه بندی