<form id="tj" class="tj" runat="server" name="form1">
<div class="input">
<table cellpadding="0" cellspacing="1" >
<tbody>
<tr>
<td><span id="sp1">*</span>存入金額 </td>
<td>
<input type="text" id="input"/>
<span style="color:#CCC;">最低存入金額為1000元</span>
</td>
</tr>
<tr>
<td><span id="sp1">*</span>幣種 </td>
<td >
<select name="bz" id="sel1" onChange="getBz(this)" style="margin-left:20px;">
<option>請選擇幣種</option>
</select>
</td>
</tr>
<tr>
<td><span id="sp1">*</span>存期 </td>
<td >
<select name="city" style="margin-left:20px;" id="sel2">
<option>請選擇存期</option>
</select>
</td>
</tr>
<tr>
<td><span id="sp1">*</span>年利率 </td>
<td >
<input type="text" id="nl3" style="width:100px; margin-left:20px;"/><span>%</span>
上浮區間<input type="text" id="nl3" style="width:100px; margin-left:20px;" value="0"/><span>%</span>
</td>
</tr>
<tr>
<td><span id="sp1">*</span>存入日期 </td>
<td>
<input type="text" class="date" id="EntTime32" name="EntTime32" onclick="return showCalendar('EntTime32', 'y-mm-dd');" value="" /><span>請點擊</span>
</td>
</tr>
<script language="javascript">
var d = new Date();
var s = d.getYear() + "-" + (d.getMonth()+1) + "-" + d.getDate() ;
document.getElementById('EntTime32').value = s;
var a = s + document.getElementById('sel2');
document.getElementById('EntTime31').value = a;
</script>
<tr>
<td><span id="sp1">*</span>提取日期 </td>
<td>
<input type="text" class="date" id="EntTime31" name="EntTime31" onclick="return showCalendar('EntTime31', 'y-mm-dd');" /><span>請點擊</span>
</td>
</tr>
</tbody>
</table>
</div>
<div class="output">
<h4>計算結果</h4>
<hr class="hi"/>
<table cellpadding="0" cellspacing="1" >
<tbody>
<tr>
<td>利息總額 </td>
<td><input id="lj" type="text"/><input id="dw" /><td>
</tr>
<tr>
<td>本息合計 </td>
<td><input id="lj" type="text"/><input id="dw1" /></td>
</tr>
<tr>
<td>利息稅 </td>
<td><input id="lj" type="text"/><input id="dw2" /></td>
<td><a onClick="showHide2()">明細詳情</a></td>
</tr>
</tbody>
</table>
<div id="tex2" style="display:none;">
<table cellpadding="0" cellspacing="1" >
<tbody>
<dl style="padding-right:18px;">
<dt class="listeara" >
<div>轉存期次</div>
<div>償還本息(元) </div>
<div>償還利息(元)</div>
<div>計算公式(元) </div>
<div>日期(元) </div>
</dt>
</dl>
<dl class="list" >
<label class="lab">
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
<p>fdgrrgergeedd,dmdmsdmf;sdkf;lksd;fksd;lfkd;slkfl;sdkf;lsdkf;ldskf;lsdkf;lsdkfl</p>
</label>
</dl>
</tbody>
</table>
</div>
</div>
</form>
</div>
就是存入日期(當前日期) + 存期 = 提取日期
也就是說 今天的日期 加上存期的下拉框裡的所顯示的文字(三個月 90天) 比如 2016-1-13 + 三個月 =2016-4-13
這個用jQuery怎麼寫 ????
還有就是 我在myeclipse裡運行 那個存入日期 是當前日期 但是在網頁上運行就這個樣子了
這個很簡單啦,就是js時間處理的問題,
var date = new Date("2016-01-13");//存入日期
var cunqi = parseInt("3");//3是獲取的存期
date.setMonth(date.getMonth()+cunqi);//設置時間,得到提取日期
var timeStr = date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate();//提取日期格式化,再給提取日期賦值就行了:如:$("#提取日期").val(timeStr);
alert(timeStr);
有問題再問我