<script language="javascript">
var i=0;
function hetongSelect()
{
if(i==0)
{
document.getElementById("indicator").style.display="block";
loginService.hetongSelect(callback);
i=1;
}
}
function callback(data)
{
document.getElementById("indicator").style.display="none";
DWRUtil.addOptions("hetong_id",data,"id","mingcheng");
}
</script><body leftmargin="2" topmargin="9" background='<%=path %>/images/allbg.gif'>
<form action="<%=path %>/tixing?type=tixingAdd" name="formAdd" method="post">
<table width="98%" align="center" border="0" cellpadding="4" cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom:8px">
<tr bgcolor="#EEF4EA">
<td colspan="3" background="<%=path %>/images/wbg.gif" class='title'><span>合同收款提醒</span></td>
</tr>
<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
<td width="25%" bgcolor="#FFFFFF" align="right">
合同信息:<img id="indicator" src="<%=path %>/img/loading.gif" style="display:none"/>
</td>
<td width="75%" bgcolor="#FFFFFF" align="left">
<select name="hetong_id" id="hetong_id" onclick="hetongSelect()" style="width: 331px;">
</select>
</td>
</tr>
<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
<td width="25%" bgcolor="#FFFFFF" align="right">
收款时间:
</td>
<td width="75%" bgcolor="#FFFFFF" align="left">
<input name="shoukuanshijian" readonly="readonly" class="Wdate" style="width: 331px;" type="text" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"/>
</td>
</tr>
<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
<td width="25%" bgcolor="#FFFFFF" align="right">
收款金额:
</td>
<td width="75%" bgcolor="#FFFFFF" align="left">
<input value="2000" type="text" name="shoukuanjine" style="width: 331px;" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"/>
</td>
</tr>
<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
<td width="25%" bgcolor="#FFFFFF" align="right">
</td>
<td width="75%" bgcolor="#FFFFFF" align="left">
<input type="button" value="提交" onclick="check()"/>
<input type="reset" value="重置"/>
</td>
</tr>
</table>
</form>
</body>读取不到下拉列表数据:怎么弄?
var i=0;
function hetongSelect()
{
if(i==0)
{
document.getElementById("indicator").style.display="block";
loginService.hetongSelect(callback);
i=1;
}
}
function callback(data)
{
document.getElementById("indicator").style.display="none";
DWRUtil.addOptions("hetong_id",data,"id","mingcheng");
}
</script><body leftmargin="2" topmargin="9" background='<%=path %>/images/allbg.gif'>
<form action="<%=path %>/tixing?type=tixingAdd" name="formAdd" method="post">
<table width="98%" align="center" border="0" cellpadding="4" cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom:8px">
<tr bgcolor="#EEF4EA">
<td colspan="3" background="<%=path %>/images/wbg.gif" class='title'><span>合同收款提醒</span></td>
</tr>
<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
<td width="25%" bgcolor="#FFFFFF" align="right">
合同信息:<img id="indicator" src="<%=path %>/img/loading.gif" style="display:none"/>
</td>
<td width="75%" bgcolor="#FFFFFF" align="left">
<select name="hetong_id" id="hetong_id" onclick="hetongSelect()" style="width: 331px;">
</select>
</td>
</tr>
<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
<td width="25%" bgcolor="#FFFFFF" align="right">
收款时间:
</td>
<td width="75%" bgcolor="#FFFFFF" align="left">
<input name="shoukuanshijian" readonly="readonly" class="Wdate" style="width: 331px;" type="text" onfocus="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"/>
</td>
</tr>
<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
<td width="25%" bgcolor="#FFFFFF" align="right">
收款金额:
</td>
<td width="75%" bgcolor="#FFFFFF" align="left">
<input value="2000" type="text" name="shoukuanjine" style="width: 331px;" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"/>
</td>
</tr>
<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='red';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
<td width="25%" bgcolor="#FFFFFF" align="right">
</td>
<td width="75%" bgcolor="#FFFFFF" align="left">
<input type="button" value="提交" onclick="check()"/>
<input type="reset" value="重置"/>
</td>
</tr>
</table>
</form>
</body>读取不到下拉列表数据:怎么弄?
JAVA框架
package com.action;import java.io.IOException;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import com.dao.DB;
import com.orm.TAdmin;
import com.orm.Thetong;
import com.orm.Ttixing;
import com.service.liuService;public class tixing_servlet extends HttpServlet
{
public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException, IOException
{
String type=req.getParameter("type");
if(type.endsWith("tixingAdd"))
{
tixingAdd(req, res);
}
}
public void tixingAdd(HttpServletRequest req,HttpServletResponse res)
{
int hetong_id=Integer.parseInt(req.getParameter("hetong_id"));
String shoukuanshijian=req.getParameter("shoukuanshijian");
int shoukuanjine=Integer.parseInt(req.getParameter("shoukuanjine"));
String sql="insert into t_tixing values(?,?,?)";
Object[] params={hetong_id,shoukuanshijian,shoukuanjine};
DB mydb=new DB();
mydb.doPstm(sql, params);
mydb.closed();
req.setAttribute("msg", "添加提醒成功!");
String targetURL = "/common/msg.jsp";
dispatch(targetURL, req, res);
}
public void dispatch(String targetURI,HttpServletRequest request,HttpServletResponse response)
{
RequestDispatcher dispatch = getServletContext().getRequestDispatcher(targetURI);
try
{
dispatch.forward(request, response);
return;
}
catch (ServletException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
}
public void init(ServletConfig config) throws ServletException
{
super.init(config);
}
public void destroy()
{
}
}