下面是我的部分代码:
JS代码:
<script type="text/javascript" language="javascript"> 
function getCt(ct){
document.PersonForm.cnum.value=ct;
var tmpct = document.PersonForm.cnum.value;
alert(tmpct);
<% 
String cts = request.getParameter("cnum");//上面已经赋值了 为何此处获取的值总是为空???
Long ctype = Long.parseLong(cts);
Long cardNum = jxss.getCardNum(jxs.getDealerId(),ctype);
%>
}
</script>部分 jsp代码:<tr>
  <td width="105">
    <div align="right">
   <bean:message key="DealersRecharge.cardtype" />
    </div>
</td>
         <td width="197">
<select name="cardtype" onChange="getCt(this.options[this.options.selectedIndex].value);">
     <%
EsalesCardType type = null;
 for(int i=0;i<res.size();i++){
 type = (EsalesCardType)res.get(i);
    %>
<option value="<%=type.getCardType() %>" >
<%=type.getTypeName() %> 
</option>
<% }%>
</select>
</td>
</tr>
     <tr> 
<td width="105">
<div align="right">
该类型卡库存数量
</div>
</td>
<td width="197">
<input class=input type="text" name="cnum"/>
<input class=input type="text" name="nums" value="<%=cardNum %>"/>
</td>
    </tr>