在JSP中对select和textarea读取、赋值的实例
以下为引用的内容:
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<SCRIPT type=text/javascript>
function clearContent(obj){
obj.value = "";
}
function addname(obj1,obj2)
{
var oSelected = document.getElementById(obj2);
var selectedValue = oSelected.options[oSelected.selectedIndex].value;
window.alert(selectedValue);
var oarea=document.getElementById(obj1).value;
window.alert("1");
window.alert(oarea);
document.getElementById(obj1).value=selectedValue+","+oarea;
}
</SCRIPT>
<SCRIPT>
var menu_id=0;
function setPointer(theRow, thePointerColor,menu_id_over)
{
if(menu_id!=menu_id_over)
theRow.bgColor = thePointerColor;
}
function view_menu1()
{
window.location="car-managelist.jsp";
menu_id=1;
menu_1.bgColor='#D9E8FF';
menu_2.bgColor='#DDDDDD';
}
function view_menu2()
{
window.location="car-applylist.jsp";
menu_id=2;
menu_1.bgColor='#DDDDDD';
menu_2.bgColor='#D9E8FF';
}
</SCRIPT>