因为textarea没有value属性,所以必须使用其他方法进行赋值,这里我采用了js赋值的思路。
首先用隐藏框把后台数据进行接收,然后把这个隐藏框的数据传递给textarea显示。
前台部分代码如下:
<tr>
<td nowrap align="right" width="9%" >基本情况:</td>
<td colspan="2"><textarea rows="10" cols="50" name="base_case" id="base_case"></textarea></td>
<td nowrap align="right" width="9%" >服务方案:</td>
<td colspan="2"><textarea rows="10" cols="50" name="service_plan" id="service_plan"></textarea></td>
</tr>
<tr>
<td>
<input type="hidden" name="base_case_2" id="base_case_2" value="<%=sp.getBase_case() %>"/>
</td>
<td>
<input type="hidden" name="service_plan_2" id="service_plan_2" value="<%=sp.getService_plan() %>"/>
</td>
JS如下所示:
<script type="text/javascript">
function changeTextArea(){
document.getElementById("base_case").value=document.getElementById("base_case_2").value;
document.getElementById("service_plan").value=document.getElementById("service_plan_2").value;
}
</script>
最后
以上就是小巧水池最近收集整理的关于(JSP)给jsp前台页面传递参数给textarea文本框的全部内容,更多相关(JSP)给jsp前台页面传递参数给textarea文本框内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复