Jquery 如何计算退休年龄并在表单文本框中显示? 养老金计算器 $(文档).on('pagecreate','#page1',function(){ //单击或点击id为“calc”的按钮时执行一些处理 $('#calc')。在('click',function(){ //event.preventDefault(); var basic=parseInt($('#basic').val()), da=parseInt($('#da').val()), years=parseInt($('#years').val()), ca=parseInt($('#ca').val()), el=parseInt($('#el').val()), days=parseInt($('#days').val()), //comperc=parseInt($('#comperc').value()), da1=0, pbasic=0, 通勤=0, 小费=0, familyp=0, familyp1=0, cp=0, 总数=0; //基本=基本+(基本*da/100); pbasic=basic/2; da1=pbasic*da/100; 酬金=(基本+da)*15/26*年;//酬金公式 折算=(pbasic*ca/100)*8.27*12;//8.27是根据第六次CPC在60岁时的折算值 家庭养老金=(基本*30/100);//家庭养老金为基本养老金的30% familyp1=familyp+(familyp*da/100); 如果(小费>1000000) 酬金=10000000; 总计=(pbasic+da1); 如果(通勤>0) cp=(pbasic*ca/100)+da1; 其他的 (通勤=0) 如果(天数>300) 天数=300天; el=基本/30*天; 小费=小费。固定(2); el=el.toFixed(2); pbasic=pbasic.toFixed(2); cp=cp.toFixed(2); 通勤=固定的通勤时间(2); 总计=总计。toFixed(2); familyp=familyp.toFixed(2); familyp1=familyp1.toFixed(2); //familyp=familypFixed(2); //$(“#结果#小费”).text(小费); //$('results'pbasic').text(pbasic); //$(“#结果#总计”).text(总计); $('#datepicker').val(datepicker); $(“#结果#酬金”).val(酬金); $('results'el').val(el); $('results'pbasic').val(pbasic); $(“#结果#总计”).val(总计); $('results'cp').val(cp); $(“#结果#通勤”).val(通勤); $('results'familyp').val(familyp); $('results'familyp1').val(familyp1); }); }); 养老金计算器 出生日期 $(文档).ready(函数(){ $(#datepicker').datepicker({changeMonth:true,changeYear:true,dateFormat:'dd-mm-yy'}); }); 当前基本 服务年限 现有DA(%) 减刑(如有) 赚取假期。 函数myFunction(){ document.getElementById(“theForm”).reset(); } &抄袭;2014年Ranjan Mitra 帮助

Jquery 如何计算退休年龄并在表单文本框中显示? 养老金计算器 $(文档).on('pagecreate','#page1',function(){ //单击或点击id为“calc”的按钮时执行一些处理 $('#calc')。在('click',function(){ //event.preventDefault(); var basic=parseInt($('#basic').val()), da=parseInt($('#da').val()), years=parseInt($('#years').val()), ca=parseInt($('#ca').val()), el=parseInt($('#el').val()), days=parseInt($('#days').val()), //comperc=parseInt($('#comperc').value()), da1=0, pbasic=0, 通勤=0, 小费=0, familyp=0, familyp1=0, cp=0, 总数=0; //基本=基本+(基本*da/100); pbasic=basic/2; da1=pbasic*da/100; 酬金=(基本+da)*15/26*年;//酬金公式 折算=(pbasic*ca/100)*8.27*12;//8.27是根据第六次CPC在60岁时的折算值 家庭养老金=(基本*30/100);//家庭养老金为基本养老金的30% familyp1=familyp+(familyp*da/100); 如果(小费>1000000) 酬金=10000000; 总计=(pbasic+da1); 如果(通勤>0) cp=(pbasic*ca/100)+da1; 其他的 (通勤=0) 如果(天数>300) 天数=300天; el=基本/30*天; 小费=小费。固定(2); el=el.toFixed(2); pbasic=pbasic.toFixed(2); cp=cp.toFixed(2); 通勤=固定的通勤时间(2); 总计=总计。toFixed(2); familyp=familyp.toFixed(2); familyp1=familyp1.toFixed(2); //familyp=familypFixed(2); //$(“#结果#小费”).text(小费); //$('results'pbasic').text(pbasic); //$(“#结果#总计”).text(总计); $('#datepicker').val(datepicker); $(“#结果#酬金”).val(酬金); $('results'el').val(el); $('results'pbasic').val(pbasic); $(“#结果#总计”).val(总计); $('results'cp').val(cp); $(“#结果#通勤”).val(通勤); $('results'familyp').val(familyp); $('results'familyp1').val(familyp1); }); }); 养老金计算器 出生日期 $(文档).ready(函数(){ $(#datepicker').datepicker({changeMonth:true,changeYear:true,dateFormat:'dd-mm-yy'}); }); 当前基本 服务年限 现有DA(%) 减刑(如有) 赚取假期。 函数myFunction(){ document.getElementById(“theForm”).reset(); } &抄袭;2014年Ranjan Mitra 帮助,jquery,html,datepicker,Jquery,Html,Datepicker,这是一个非常简单的中央政府雇员养老金计算器。结果仅为近似值 一,。在第一个文本框中输入您的基本工资(即基本工资+等级工资),NPA代表非执业津贴,适用于政府医生、律师等。, 如果您收到任何NPA,请同时添加(基本+GP+NPA) 二,。在第二个文本框中输入已完成的服务年限 三,。在第三个文本框中,输入不带百分号(%)的当前DA速率 四,。现在单击“计算”按钮。您将获得您的小费金额、基本养老金金额 还有你的养老金 5.单击“重置”按钮以使用不同的值集计算AGIA或 6.2006年1月1日,所有酬金

这是一个非常简单的中央政府雇员养老金计算器。结果仅为近似值

一,。在第一个文本框中输入您的基本工资(即基本工资+等级工资),NPA代表非执业津贴,适用于政府医生、律师等。, 如果您收到任何NPA,请同时添加(基本+GP+NPA)

二,。在第二个文本框中输入已完成的服务年限

三,。在第三个文本框中,输入不带百分号(%)的当前DA速率

四,。现在单击“计算”按钮。您将获得您的小费金额、基本养老金金额 还有你的养老金

5.单击“重置”按钮以使用不同的值集计算AGIA或

6.2006年1月1日,所有酬金的最高限额已提高到1000万卢比(之前的限额为350万卢比)。日期为 此外,退休年龄还增加了计算酬金的工资

七,。对于减刑金额的支付,委员会注意到,各种因素表明,15年后恢复减刑金额的程序似乎更加公平。年龄系数已按照第六次CPC年龄=60系数=8.287计算

八,。已获得的假期兑现按允许的最大300天计算。输入的任何数量大于300将只计算允许的最大天数。

*(要转到上一页,请单击手机后退按钮)

&抄袭;2014年Ranjan Mitra 结果 您的退休日期: 您的小费: EL已兑现金额: 您的基本养老金: 您的养老金: 收到的折算金额: 您减少的养老金: 家庭基本养老金: 家庭养老金: &抄袭;2014年Ranjan Mitra 这些计算非常有效。 1.添加了日期选择器。 2.添加了日期选择器的文本框 3.在结果表单中添加了计算退休年龄的文本框。 现在计算不起作用了! 如何以日/月/年格式显示退休日期(从出生日期算起60年)? 示例:如果dob=1.1.1949,则显示的退休日期应为2009年1月31日,每个月的退休日期应类似。如果dob=2.3.1950,则显示的退休日期应为2010年3月30日。
无法计算它需要帮助。

您可以根据此处的文档使用此选项设置年份范围
http://api.jqueryui.com/datepicker/#option-年份范围

<!DOCTYPE html> 
<html>
<head>
<meta charset="utf-8">
<meta content='width=device-width, initial-scale=1' name='viewport'/>
<title>Pension Calculator</title>

<link rel="stylesheet" href="js1/jquery.mobile-1.4.3.css" type="text/css"/>
<link rel="stylesheet" href="js1/jquery.mobile.structure-1.4.3.min.css">
<script src="js1/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="js1/jquery.mobile-1.4.3.min.js" type="text/javascript"></script>
<link type="text/css" href="jquery-ui-1.8.16.custom/css/sunny/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script src="jquery-ui-1.8.16.custom/js/jquery-1.6.2.min.js"></script>
<script src="jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js"></script>


<script>
   $(document).on('pagecreate', '#page1', function() {
     // Do some processing when the button with id 'calc' is clicked or tapped

    $('#calc').on('click', function() {        
        //event.preventDefault();
          var basic = parseInt($('#basic').val()),
              da = parseInt($('#da').val()),
              years = parseInt($('#years').val()),
              ca = parseInt($('#ca').val()),
              el = parseInt($('#el').val()),
              days = parseInt($('#days').val()),
             // comperc = parseInt($('#comperc').value()),

              da1 = 0,
              pbasic = 0,
              commute = 0,
              gratuity = 0,
              familyp = 0,
              familyp1 = 0,
              cp = 0,
              total = 0;



        // basic = basic + (basic*da/100);

         pbasic = basic/2; 
         da1 = pbasic*da/100;
         gratuity = (basic + da)*15/26 * years; // gratuity formula


         commute = (pbasic*ca/100)*8.27 *12; // 8.27 is the commutation value at the age of 60 as per 6th CPC
         familyp = (basic*30/100); // family pension is 30% of basic 
         familyp1 = familyp + (familyp*da/100);


        if (gratuity > 1000000)
            gratuity = 10000000;        

          total = (pbasic + da1);

          if (commute > 0)
            cp = (pbasic*ca/100) + da1; 

        else
            (commute = 0)


        if (days >300)
            days = 300;
         el = basic/30*days;

        gratuity = gratuity.toFixed(2);
        el = el.toFixed(2);
        pbasic = pbasic.toFixed(2);
        cp = cp.toFixed(2);
        commute = commute.toFixed(2);
        total = total.toFixed(2);
        familyp = familyp.toFixed(2);
        familyp1 = familyp1.toFixed(2);
        //familyp = familypFixed(2);

       // $('#results #gratuity').text(gratuity);
       // $('#results #pbasic').text(pbasic);
        //$('#results #total').text(total);

        $('#datepicker').val(datepicker);
        $('#results #gratuity').val(gratuity);
        $('#results #el').val(el);
        $('#results #pbasic').val(pbasic);
        $('#results #total').val(total);
        $('#results #cp').val(cp);
        $('#results #commute').val(commute);
        $('#results #familyp').val(familyp);
        $('#results #familyp1').val(familyp1);

    });

});
</script>
</head>



<body>

 <div id="page1" data-role="page" data-theme="b">
    <header data-role="header">
        <h2>Pension Calculator</h2>  
    <img src="banner5.jpg" width="562" height="95">
    </header>

<div role="main" class="ui-content">
        <form id="theForm">

           <div data-role="fieldcontain" data-inset="true" >
                <label for="birth_date">Date of Birth</label>
                <input type="text" name="birth_date" id="datepicker" autofocus required />
            </div>

<script>
  $(document).ready(function(){
  $('#datepicker').datepicker({changeMonth: true, changeYear: true, dateFormat: 'dd-mm-yy'});
});
  </script>

           <div data-role="fieldcontain" data-inset="true" >
                <label for="basic">Present Basic</label>
                <input type="number" name="basic" id="basic" value="0" autofocus required />
            </div>
            <div data-role="fieldcontain">
                <label for="years">Years of Service</label>
                <input type="number" name="years" id="years" value="0" required />
            </div>
            <div data-role="fieldcontain">
                <label for="da">Existing DA (%)</label>
                <input type="number" name="da" id="da" value="0" required />
            </div>

            <div data-role="fieldcontain">
                <label for="ca">Commutation if any (%)</label>
                <input type="number" name="ca" id="ca" value="0" required />
            </div>

            <div data-role="fieldcontain">
                <label for="el">Earned Leave Nos.</label>
                <input type="number" name="days" id="days" value="0" required />
            </div>


        <a id="calc" href="#results" data-role="button" data-icon="gear">Calculate</a>


         <div data-role="fieldcontain" data-inset="true">

       <input type="button" onclick="myFunction()" id="theForm" data-icon="gear" value="Reset Values">
        </div>
        <script>
        function myFunction() {
        document.getElementById("theForm").reset();
        }

        </script>

        <a id="help" href="#help" data-role="button" data-icon="info">Help</a>      

<div data-role="footer" data-position="fixed" data-tap-toggle="false">
         <h3>&copy; Ranjan Mitra 2014</h3>
</div>
   </form>

</div>
</div>

<div id="help" data-url="help" data-role="page" data-theme="b">
    <div data-role="header">
    <h2>Help</h2>
     <img src="help1.jpg" width="561" height="64">
     </div>
     <div data-role="content">
     <p>
     <p>This is a very simple Pension Calculator for Central Govt. Emplyees. The results are apprroximate only.</p>
     <p> 1. In the first text box enter your basic (Which is Basic + Grade Pay) the NPA stands for Non Practising Allowance which is applicable for Govt. Doctors, Lawyers etc., 
         if you receive any NPA please add it also (Basic + GP + NPA)</p>
     <p> 2. In the second text box enter completed years of service. </p>
     <p> 3. In the third text box enter the current DA rate without the percent (%) sign.</p>
     <p> 4. Now click the calculate button. You will get your Gratuity amount, Basic Pension amount
       and your Pension.</p>
     <p> 5.Click the the reset button to calculate agian or with a different set of values.</p>
     <p> 6.Ceiling on all gratuities has been raised to Rs. ten lakhs w.e.f 01.01.2006 (earlier the limit was Rs.3.5 lakhs). DA admissible on the date  
         of retirement has also been added with pay for calculation of gratuity.</p>
     <p> 7. For payment of commutation amount the Commission has noted that various factors suggest that the procedure of restoration of commuted amount after 15years appears to be more than fair. Age Factor has been calculated as per 6th CPC Age = 60 Factor = 8.287</p>
     <p> 8. Earned Leave encashment has been calculated on the basis of maximum 300 days as allowed. Any ammount enterd greater than 300 will only calculate the maximum days allowed.</p> 
     <p> *(To go to a previous page click your mobile phones back button).</p>
     </div>


<div data-role="footer" data-position="fixed" data-tap-toggle="false">
         <h3>&copy; Ranjan Mitra 2014</h3>
     </div>
      </div>

<div id="results" data-url="results" data-role="page" data-theme="b">
    <div data-role="header">
        <h2>Results</h2>
    <img src="banner4.jpg" width="562" height="95">
    </div>
    <div role="main" class="ui-content">


     <div class="ui-field-contain" >
    <label for="datepicker">Your Date of Retirement:</label>
    <input type="text" style="color:#FFFF00;" name="datepicker" id="datepicker" readonly/>
        </div>


    <div class="ui-field-contain" >
    <label for="gratuity">Your Gratuity:</label>
    <input type="text" style="color:#FFFF00;" name="gratuity" id="gratuity" value="0" readonly/>
        </div>


    <div class="ui-field-contain" >
    <label for="el">EL Encashed Amount:</label>
    <input type="text" style="color:#FFFF00;" name="el" id="el" value="0" readonly/>
        </div>

     <div class="ui-field-contain">
    <label for="pbasic">Your Basic Pension:</label>
    <input type="text" style="color:#00FF00" name="pbasic" id="pbasic" value="0" readonly/>
         </div>        

    <div class="ui-field-contain">
    <label for="total">Your Pension:</label>
    <input type="text" style="color:#FF0000" name="total" id="total" value="0" readonly/>
    </div>

    <div class="ui-field-contain">
    <label for="commute">Commuted Amount Received:</label>
    <input type="text" style="color:#FFFF00" name="commute" id="commute" value="0" readonly/>
    </div>

    <div class="ui-field-contain">
    <label for="cp">Your Reduced Pension:</label>
    <input type="text" style="color:#FF00FF" name="cp" id="cp" value="0" readonly/>
    </div>

    <div class="ui-field-contain">
    <label for="familyp">Family Basic Pension:</label>
    <input type="text" style="color:#00FF00" name="familyp" id="familyp" value="0" readonly/>
    </div>

    <div class="ui-field-contain">
    <label for="familyp1">Family Pension:</label>
    <input type="text" style="color:#FF0000" name="familyp1" id="familyp1" value="0" readonly/>
    </div>


</div> 
</div>
          <div data-role="footer" data-position="fixed" data-tap-toggle="false">
         <h3>&copy; Ranjan Mitra 2014</h3>
     </div>
</body>
</html>   
“那太好了
yearRange: '2004:2024', // specifying a hard coded year range

dateFormat: 'dd-mm-yy' //date format