js取得当前下拉框所选择的值,怎么用到jsp中? if(document.getElementById("下拉框的ID").value==""){}看看这样行不行,说实话感觉你的代码好拥挤,可以使用jquery来进行取值捏 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我们不能用jquery 。。 <tr> <td width='10%' class="left">车价输出:</td> <td width='30%' class="right"> <select id="priceKind" name="" > <option value="" ></option> <option value="newCarPrice" >新车购置价</option> <option value="newKindPrice" >类比价格</option> </select> </td> </tr>下拉框做了一个选择项,if(document.getElementById("priceKind").value=="newCarPrice"){ window.opener.fm.PurchasePrice.value = purchasePrice; }else if(document.getElementById("priceKind").value=="newKindPrice"){ window.opener.fm.PurchasePrice.value = kindRedPriceTax; }else{ window.opener.fm.CarActualValue.value = carActualValue; window.opener.fm.PurchasePrice.value = purchasePrice; window.opener.fm.CarActualValueTrue.value = purchasePrice; 我在js里做了一个判断,选择新车价就返回新车价,选择类比价就返回类比价,如果不选,按原代码走原代码<tr class="<%=trClass%>" onclick="submitForm('<%if(strPurchasePriceTaxComCode.indexOf(strComCode.substring(0,2))>-1){ %> ,'<%=new DecimalFormat("0.00").format(Double.parseDouble(prpDcarModelSchema.getPurchasePriceTax()))%>' ,'<%=new DecimalFormat("0.00").format(Double.parseDouble(prpDcarModelSchema.getPurchasePriceTax()))%>' <%}else{ %> ,'<%=new DecimalFormat("0.00").format(Double.parseDouble(prpDcarModelSchema.getPurchasePrice()))%>' ,'<%=new DecimalFormat("0.00").format(Double.parseDouble(prpDcarModelSchema.getPurchasePrice()))%>' <%} %>有一个根据机构的不同所返回的价钱不同。 用Jquery 或者 jstl 的标签取值啊,在jsp 里面写这么多java代码 太不好看了 首先要理解一点,jsp是服务器语言,js是客户端语言,在页面打开以后,jsp里面的代码已经执行了,生成了最终访问的html,你再用js是不能再处理jsp的代码,要想做一些需要jsp来做的处理,就用ajax把js的值传给另一个jsp页面来处理。可以学习一下ajax 100分求A股实时交易数据的获取方式 jsp用什么在线编辑器 FCKeditor不能插入图片 送分,求解个小问题,基本类型的包装器类 下载文件时为什么要刷新一遍才能下载 表格中,怎么使被选中的行改变颜色啊 tomcat中启动时找不到struts中配置类 菜问:SERVLET和数据库,写过SERVLET的都可以进来看看 HTML显示一个表格怎么才能指定宽度后该显示多少就是多少,不换行不按比例增减 poi 操作单元格 背景色的问题 如何实现action的行为,,,, 求救!tomcat外网访问的问题~感激不尽 卖家怎么拿到钱?实现易宝接口的步骤?调试?商户编号?
我们不能用jquery 。。
<td width='10%' class="left">车价输出:</td>
<td width='30%' class="right">
<select id="priceKind" name="" >
<option value="" ></option>
<option value="newCarPrice" >新车购置价</option>
<option value="newKindPrice" >类比价格</option>
</select>
</td>
</tr>下拉框做了一个选择项,if(document.getElementById("priceKind").value=="newCarPrice"){
window.opener.fm.PurchasePrice.value = purchasePrice;
}else if(document.getElementById("priceKind").value=="newKindPrice"){
window.opener.fm.PurchasePrice.value = kindRedPriceTax;
}else{
window.opener.fm.CarActualValue.value = carActualValue;
window.opener.fm.PurchasePrice.value = purchasePrice;
window.opener.fm.CarActualValueTrue.value = purchasePrice; 我在js里做了一个判断,选择新车价就返回新车价,选择类比价就返回类比价,如果不选,按原代码走原代码<tr class="<%=trClass%>"
onclick="submitForm('<%if(strPurchasePriceTaxComCode.indexOf(strComCode.substring(0,2))>-1){ %>
,'<%=new DecimalFormat("0.00").format(Double.parseDouble(prpDcarModelSchema.getPurchasePriceTax()))%>'
,'<%=new DecimalFormat("0.00").format(Double.parseDouble(prpDcarModelSchema.getPurchasePriceTax()))%>'
<%}else{ %>
,'<%=new DecimalFormat("0.00").format(Double.parseDouble(prpDcarModelSchema.getPurchasePrice()))%>'
,'<%=new DecimalFormat("0.00").format(Double.parseDouble(prpDcarModelSchema.getPurchasePrice()))%>'
<%} %>
有一个根据机构的不同所返回的价钱不同。