`

select 两级联动

 
阅读更多
<%@ 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>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics