日期:2014-05-16  浏览次数:20400 次

感觉有点困难的JS实现问题
看得一段程序:
页面一个通过JS获取开始时间输入框: <input name="开始时间" id="Begintime" runat="server" type="text" class="input150" readonly=readonly onclick="javascript:getDateTime('Begintime',1);" />
通过一个轮数选择触发ForRoundDetails()方法: <select id="BRound" class="detail_edit" runat=server onchange="ForRoundDetails();"> 
<option value="0">0</option>option value="1">1</option><option value="2">2</option>
<option value="3">3</option> </select>
下面代码是是通过每次都选择开始结束时间达到目的,(比如Bround值选的3,则)
ForRoundDetails(){
var BRound = parseInt($("#BRound").val());//alert(BRound);
  var str = "<table width='100%' border='0' align='center' cellpadding='1' cellspacing='0'>";
   
  if (BidingRound > 1) {
  for(var i=0;i<BidingRound;i++){
  str += "<tr>";

  str += "<td style='width:50%;height:23px'>";
  //str += "第" + (i + 1) + "次时间从:<input type='text' name='roundbegin' id='roundbegin" + i + "' style='width:60%;height:22px' size='77' readonly='readonly' onclick=\"getDateTime('roundbegin" + i + "',1)\" />";
  if (i == 0) {
  str += "第" + (i + 1) + "次时间从:<input type='text' name='roundbegin' id='roundbegin" + i + "' class='input150' stype='width:50px;height:22px' size='77' readonly='readonly' onclick=\"getDateTime('roundbegin" + i + "',1)\" />";
  }
  else {
  str += "第" + (i + 1) + "次时间从:<input type='text' name='roundbegin' id='roundbegin" + i + "' class='input150' stype='width:50px;height:22px' size='77' readonly='readonly' onclick=\"GetRoundStart('roundbegin" + i + "','roundend" + (i - 1) + "')\" />";
  }
  str += "开始</td><td style='width:50%;height:22px'>到<input type='text' name='roundend' id='roundend" + i + "' class='input150' style='width:60%;height:22px' size='77' readonly='readonly' onclick=\"getDateTime('roundend" + i + "',1)\" />"
  str += "</td>";

  str += "</tr>";
  }
  }
  str += "</table>"; //alert(str);
}
现在想要改为加一个间隔时间的选择项(分钟)<select id="OnceTime" style="width:99%" class="detail_edit" runat=server > 
 <option value="0">10</option><option value="1">15</option> <option value="2">20</option>
 <option value="3">25</option><option value="4">30</option> </select>
选择轮数之后根据选择的时间间隔直接自动填充时间,(开始时间默认就是帖子开始的那个时间输入框Begintime的值)

 

------解决方案--------------------
看得头昏昏的,还是没明白
问题不知道困不困难,理解你的描述相当困难,没办法
------解决方案--------------------
你的代码没看,但我的思路是加个定时器,比如:
JScript code
var _timer;
function AutoFillDate()
{
   //这里是你要直接自动填充时间的操作
}