select 两级联动 博客分类: javascript
程序员文章站
2024-03-26 12:11:53
...
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/jsp/taglib.jsp" %>
<script type='text/javascript' src='/dwr/interface/expertView.js'></script>
<script type='text/javascript' src='/dwr/engine.js'></script>
<script type='text/javascript' src='/dwr/util.js'></script>
<script type="text/javascript" src="${htl }/common/scripts/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${htl }/fckeditor/fckeditor.js"></script>
<title>专家看点新增</title>
<script type="text/javascript">
function changeSelect()
{
var expertTypeId=document.getElementById("expertTypeId").value;
expertView.queryExpert(expertTypeId,returnData);
}
function returnData(data)
{
var obj=document.getElementById("expert");
if(data!=null)
{
obj.length=0;
obj.options[obj.length]=new Option('---请选择---','');
for(var i=0;i<data.length;i++)
{
obj.options[obj.length]=new Option(data[i]["expertName"],data[i]["expertId"]);
}
}
}
function addExpertView()
{
if(document.getElementById("expertTypeId").value==""){
alert("请选择专家类型");
return;
}
if(document.getElementById("expert").value==""){
alert("请输入专家姓名");
return;
}
document.form1.action="<%=request.getContextPath() %>/expertView!add.do";
document.form1.submit();
}
</script>
<div id="maincontent">
<div id="mainc" class="da">
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30"><h4>专家看点新增</h4></td>
</tr>
</table>
<form name="form1" method="post" enctype="multipart/form-data">
<table width="598" border="0" cellpadding="0" cellspacing="0" class="formbiao" style="font-size:12px">
<s:hidden id="expertViewId" name="expertViewId" />
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">标题</span></td>
<td align="left">
<s:textfield id="title" name="zjxExpertview.title" />
</td>
</tr>
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">专家类型</span></td>
<td align="left">
<select id="expertTypeId" name="zjxExpertview.expertViewtypeid" onchange="changeSelect()">
<option value="">---请选择---</option>
<s:iterator value="expertTypeList" id="list1" status="i">
<option value="<s:property value="#list1.expertTypeId"/>" ><s:property value="#list1.expertType"/></option>
</s:iterator>
</select>
</td>
</tr>
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">专家姓名</span></td>
<td align="left">
<select id="expert" name="zjxExpertview.expertId">
<option value="">---请选择---</option>
</select>
</td>
</tr>
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">是否最新</span></td>
<td align="left">
<input type="radio" name="zjxExpertview.isNew" checked value="0"/>否
<input type="radio" name="zjxExpertview.isNew" value="1"/>是
</td>
</tr>
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">是否置顶</span></td>
<td align="left">
<input type="radio" name="zjxExpertview.isTop" checked value="0"/>否
<input type="radio" name="zjxExpertview.isTop" value="1"/>是
</td>
</tr>
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">是否推荐</span></td>
<td align="left">
<input type="radio" name="zjxExpertview.isRecommend" checked value="0"/>否
<input type="radio" name="zjxExpertview.isRecommend" value="1"/>是
</td>
</tr>
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">专家看法</span></td>
<td align="left">
<textarea name="context" id="context" style="width:100%; height:200px;"></textarea>
<div align="left" >
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'context' ) ;
//oFCKeditor.BasePath = 'FCKeditor/' ;
oFCKeditor.ToolbarSet = 'Default' ;
oFCKeditor.Width = '100%' ;
oFCKeditor.Height = '400' ;
oFCKeditor.Value = '' ;
oFCKeditor.ReplaceTextarea();
//oFCKeditor.Create() ;
</script>
</div>
</td>
</tr>
<tr >
<td colspan="2" >
<input id="submitButton" name="submitButton" type="button" onclick="addExpertView()" value="提交" />
<input type="button" value="返回列表" onclick="window.location='<%=request.getContextPath() %>/expert!query.do'"/>
<input type="button" value="后退" onclick="history.back();"/></td>
</tr>
</table>
</form>
</div>
</div>
<%@ include file="/common/jsp/taglib.jsp" %>
<script type='text/javascript' src='/dwr/interface/expertView.js'></script>
<script type='text/javascript' src='/dwr/engine.js'></script>
<script type='text/javascript' src='/dwr/util.js'></script>
<script type="text/javascript" src="${htl }/common/scripts/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${htl }/fckeditor/fckeditor.js"></script>
<title>专家看点新增</title>
<script type="text/javascript">
function changeSelect()
{
var expertTypeId=document.getElementById("expertTypeId").value;
expertView.queryExpert(expertTypeId,returnData);
}
function returnData(data)
{
var obj=document.getElementById("expert");
if(data!=null)
{
obj.length=0;
obj.options[obj.length]=new Option('---请选择---','');
for(var i=0;i<data.length;i++)
{
obj.options[obj.length]=new Option(data[i]["expertName"],data[i]["expertId"]);
}
}
}
function addExpertView()
{
if(document.getElementById("expertTypeId").value==""){
alert("请选择专家类型");
return;
}
if(document.getElementById("expert").value==""){
alert("请输入专家姓名");
return;
}
document.form1.action="<%=request.getContextPath() %>/expertView!add.do";
document.form1.submit();
}
</script>
<div id="maincontent">
<div id="mainc" class="da">
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30"><h4>专家看点新增</h4></td>
</tr>
</table>
<form name="form1" method="post" enctype="multipart/form-data">
<table width="598" border="0" cellpadding="0" cellspacing="0" class="formbiao" style="font-size:12px">
<s:hidden id="expertViewId" name="expertViewId" />
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">标题</span></td>
<td align="left">
<s:textfield id="title" name="zjxExpertview.title" />
</td>
</tr>
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">专家类型</span></td>
<td align="left">
<select id="expertTypeId" name="zjxExpertview.expertViewtypeid" onchange="changeSelect()">
<option value="">---请选择---</option>
<s:iterator value="expertTypeList" id="list1" status="i">
<option value="<s:property value="#list1.expertTypeId"/>" ><s:property value="#list1.expertType"/></option>
</s:iterator>
</select>
</td>
</tr>
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">专家姓名</span></td>
<td align="left">
<select id="expert" name="zjxExpertview.expertId">
<option value="">---请选择---</option>
</select>
</td>
</tr>
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">是否最新</span></td>
<td align="left">
<input type="radio" name="zjxExpertview.isNew" checked value="0"/>否
<input type="radio" name="zjxExpertview.isNew" value="1"/>是
</td>
</tr>
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">是否置顶</span></td>
<td align="left">
<input type="radio" name="zjxExpertview.isTop" checked value="0"/>否
<input type="radio" name="zjxExpertview.isTop" value="1"/>是
</td>
</tr>
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">是否推荐</span></td>
<td align="left">
<input type="radio" name="zjxExpertview.isRecommend" checked value="0"/>否
<input type="radio" name="zjxExpertview.isRecommend" value="1"/>是
</td>
</tr>
<tr>
<td align="right" class="listbiaotd"><span class="lanbiaoti">专家看法</span></td>
<td align="left">
<textarea name="context" id="context" style="width:100%; height:200px;"></textarea>
<div align="left" >
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'context' ) ;
//oFCKeditor.BasePath = 'FCKeditor/' ;
oFCKeditor.ToolbarSet = 'Default' ;
oFCKeditor.Width = '100%' ;
oFCKeditor.Height = '400' ;
oFCKeditor.Value = '' ;
oFCKeditor.ReplaceTextarea();
//oFCKeditor.Create() ;
</script>
</div>
</td>
</tr>
<tr >
<td colspan="2" >
<input id="submitButton" name="submitButton" type="button" onclick="addExpertView()" value="提交" />
<input type="button" value="返回列表" onclick="window.location='<%=request.getContextPath() %>/expert!query.do'"/>
<input type="button" value="后退" onclick="history.back();"/></td>
</tr>
</table>
</form>
</div>
</div>
推荐阅读
-
js 克隆 博客分类: javascript 克隆clone复制对象
-
关于chosen-select设置选中值和清空选中值的问题 博客分类: jquery控件 chosen-select
-
iframe页通过JS修改父页面元素值 & 调用父页面JS函数的方法 博客分类: javascript
-
iframe页通过JS修改父页面元素值 & 调用父页面JS函数的方法 博客分类: javascript
-
select 两级联动 博客分类: javascript
-
关于chosen-select设置选中值和清空选中值的问题 博客分类: jquery控件 chosen-select
-
6个出色的基于JQuery的Tab选项卡实例 博客分类: javascript jquerytabs
-
支持模糊查询的替代html中select的jquery插件 博客分类: JavaScript selectjquery插件F-CSL
-
JS实现图片轮播效果 博客分类: js JavaScript图片轮播jquery说哪儿网shuonar.com
-
onstart事件 博客分类: JavaScript onstart事件