1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>My JSP 'mylist_liti.jsp' starting page</title>
  5. <script language="javascript">
  6.  
  7. var cateArray = new Array();
  8.  
  9. cateArray[cateArray.length]=new Array("1","教师系列");
  10. cateArray[cateArray.length]=new Array("2","工程师系列");
  11. cateArray[cateArray.length]=new Array("3","实验系列");
  12. cateArray[cateArray.length]=new Array("4","研究员系列");
  13.  
  14. var titleArray = new Array();
  15.  
  16. titleArray[titleArray.length]=new Array("1","教授","教授");
  17. titleArray[titleArray.length]=new Array("1","副教授","副教授");
  18. titleArray[titleArray.length]=new Array("1","讲师","讲师");
  19. titleArray[titleArray.length]=new Array("1","助教","助教");
  20.  
  21. titleArray[titleArray.length]=new Array("2","教授级高工","教授级高工");
  22. titleArray[titleArray.length]=new Array("2","高级工程师","高级工程师");
  23. titleArray[titleArray.length]=new Array("2","工程师","工程师");
  24. titleArray[titleArray.length]=new Array("2","助工","助工");
  25.  
  26. titleArray[titleArray.length]=new Array("3","教授级高级实验师","教授级高级实验师");
  27. titleArray[titleArray.length]=new Array("3","高级实验师","高级实验师");
  28. titleArray[titleArray.length]=new Array("3","实验师","实验师");
  29. titleArray[titleArray.length]=new Array("3","助理实验师","助理实验师");
  30.  
  31. titleArray[titleArray.length]=new Array("4","研究员","研究员");
  32. titleArray[titleArray.length]=new Array("4","副研究员","副研究员");
  33. titleArray[titleArray.length]=new Array("4","助理研究员","助理研究员");
  34. titleArray[titleArray.length]=new Array("4","实习研究员","实习研究员");
  35.  
  36. function setTitle(obj1ID,obj2ID){
  37. var objCate = document.getElementById(obj1ID);
  38. var objTitle = document.getElementById(obj2ID);
  39. var i;
  40. var itemArray = null;
  41. if(objCate.value.length > 0){
  42. itemArray = new Array();
  43. for(i=0;i<titleArray.length;i++){
  44. if(titleArray[i][0]==objCate.value){
  45. itemArray[itemArray.length]=new Array(titleArray[i][1],titleArray[i][2]);
  46. }
  47. }
  48. }
  49. for(i = objTitle.options.length ; i >= 0 ; i--){
  50. objTitle.options[i] = null;
  51. }
  52. objTitle.options[0] = new Option("请选择职称");
  53. objTitle.options[0].value = "";
  54. if(itemArray != null){
  55. for(i = 0 ; i < itemArray.length; i++){
  56. objTitle.options[i+1] = new Option(itemArray[i][1]);
  57. if(itemArray[i][0] != null){
  58. objTitle.options[i].value = itemArray[i][0];
  59. }
  60. }
  61. }
  62.  
  63. }
  64. </script>
  65. </head>
  66.  
  67. <body
  68. style="background: url(${ctx }/images/iframe_bg.gif) repeat-x; margin: 2px;">
  69.  
  70. <div id="create"
  71. style="border: 1px solid #84a1bd; margin: 10px 250px; ">
  72. <form name="createForm"
  73. action="${ctx}/sys/tea.do?method=createTea" method="post">
  74. <table width="60%" align="center" cellpadding="0" cellspacing="0"
  75. style="font-size: 13px;">
  76. <tr>
  77. <td colspan="2" align="center">
  78. <br/>
  79. 新增教师用户
  80. </td>
  81. <tr>
  82. <td align="center" width="28%" height="30">
  83. 教师编号
  84. </td>
  85. <td align="left">
  86.   
  87. <input type="text" name="number" />
  88.  
  89. </td>
  90. </tr>
  91. <tr>
  92. <td align="center" width="28%" height="30">
  93. 教师姓名
  94. </td>
  95. <td align="left">
  96.   
  97. <input type="text" name="name" />
  98.  
  99. </td>
  100. </tr>
  101. <tr>
  102. <td align="center" width="28%" height="30">
  103. 职称类型
  104. </td>
  105. <td align="left">
  106.   
  107. <select name="cateid" id="cateid" onChange="setTitle('cateid','titleid')">
  108. <option value="">请选职称类型</option>
  109. <option value="1" >
  110. 教师系列
  111. </option>
  112. <option value="2">
  113. 工程师系列
  114. </option>
  115. <option value="3">
  116. 实验系列
  117. </option>
  118. <option value="4">
  119. 研究员系列
  120. </option>
  121. </select>
  122.  
  123. </td>
  124. </tr>
  125. <tr>
  126. <td align="center" width="28%" height="30">
  127. 职     称
  128. </td>
  129. <td align="left">
  130.   
  131. <select name="title" id="titleid">
  132. <option value="暂无">
  133. 请选职称
  134. </option>
  135. </select>
  136.  
  137. </td>
  138. </tr>
  139.  
  140. <tr>
  141. <td align="center" width="28%" height="30">
  142.  
  143. </td>
  144. <td align="left">
  145.   
  146.  
  147. <a href="javascript:document.createForm.submit();">新增</a>
  148.   
  149.  
  150. </td>
  151. </tr>
  152. </table>
  153. </form>
  154. </div>
  155.  
  156. <br />
  157. </body>
  158. </html>

两个select级联操作实例(教师职称类型与职称)的更多相关文章

  1. jqery对于select级联操作

    问题:今天在做一个需求的时候,有一个级联操作也就是选中下拉框的一列就显示对对应的数据 处理:我在做级联的时候在option的列里面绑定click的事件发现这个事件行不通:查资料发现select触发的是 ...

  2. Spring boot配置多个Redis数据源操作实例

    原文:https://www.jianshu.com/p/c79b65b253fa Spring boot配置多个Redis数据源操作实例 在SpringBoot是项目中整合了两个Redis的操作实例 ...

  3. jQuery获取Radio选择的Value值||两个select之间option的互相添加操作(jquery实现)

    jQuery获取Radio选择的Value值: 1. $("input[name='radio_name'][checked]").val();  //选择被选中Radio的Val ...

  4. Sql Server 函数的操作实例!(执行多条语句,返回Select查询后的临时表)

    Sql Server 函数的操作实例!(执行多条语句,返回Select查询后的临时表) SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ==== ...

  5. Sql Server 函数的操作实例!(返回一条Select语句查询后的临时表)

    Sql Server 函数的操作实例!(返回一条Select语句查询后的临时表) SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUN ...

  6. PHP.30-TP框架商城应用实例-后台6-商品会员价格删除-外键,级联操作

    商品会员价格删除 需求:当删除一件商品时,这件商品对应的会员价格也应该从会员价格表{price,level_id,goods_id}中删除掉. 有两种删除方法 1.在钩子函数_before_delet ...

  7. [原创]关于Hibernate中的级联操作以及懒加载

    Hibernate: 级联操作 一.简单的介绍 cascade和inverse (Employee – Department) Casade用来说明当对主对象进行某种操作时是否对其关联的从对象也作类似 ...

  8. Java三大框架之——Hibernate关联映射与级联操作

    什么是Hibernate中的关联映射? 简单来说Hibernate是ORM映射的持久层框架,全称是(Object Relational Mapping),即对象关系映射. 它将数据库中的表映射成对应的 ...

  9. 安卓 SQLite数据库操作实例

    前段时间写了个安卓平台下SQLite数据库操作的实例 ,一直没得时间总结 ,今天把它弄出来了. 在Android 运行时环境包含了完整的 SQLite. 首先介绍一下SQLite这个数据库: SQLi ...

随机推荐

  1. IIS虚拟目录实现与文件服务器网络驱动器映射共享

    这篇文章转载别人,想原创作者致敬! 我本人也遇到同样的问题,故转载记录. 本文重点描述如何使用IIS访问共享资源来架设站点或执行 ASP.Net 等脚本. 通常情况下,拥有多台服务器的朋友在使用IIS ...

  2. [topcoder]FoxAndChess

    http://community.topcoder.com/stat?c=problem_statement&pm=12725&rd=15702 这题比较简单.首先所有的LR的顺序要一 ...

  3. *[topcoder]LittleElephantAndString

    http://community.topcoder.com/stat?c=problem_statement&pm=12854&rd=15709 这道题DIV1 250的,还有点意思. ...

  4. ANDROID_MARS学习笔记_S02_003_AutoCompleteTextView

    一. public class CountriesActivity extends Activity { protected void onCreate(Bundle icicle) { super. ...

  5. CreateObject("Wscript.Shell")用法

    WScript.Shell是WshShell对象的ProgID,创建WshShell对象可以运行程序.操作注册表.创建快捷方式.访问系统文件夹.管理环境变量. 该对象有一个run方法. Run 方法创 ...

  6. bzoj3165 1568

    1568是3165的弱化版,发的代码是3165的这道题完全没想出来,是看wyl大神的题解http://hi.baidu.com/wyl8899/item/2deafd3a376ef2d46d15e99 ...

  7. find和findstr

    find与findstr 例“ 在文件中搜索字符串. 1.findstr . 2.txt 或 Findstr "." 2.txt 从文件2.txt中查找任意字符,不包括空字符或空行 ...

  8. zookeeper 客户端编程

    zookeeper是一个分布式的开源的分布式协调服务,用它可以来现同步服务,配置维护.zookeeper的稳定性也是可以保证的,笔者曾参与过的使用zookeeper的两个应用,一个是用zookeepe ...

  9. 找出Java进程中大量消耗CPU

    原文:https://github.com/oldratlee/useful-shells useful-shells 把平时有用的手动操作做成脚本,这样可以便捷的使用. show-busy-java ...

  10. HDU 4799 LIKE vs CANDLE 树形dp

    题意:有n个人,他们的关系,形成一棵有根树(0是树根,代表管理员),每个人有一个价值 现在有一条微博,每个人要么点赞,要么送一个蜡烛 初始一些人利用bug反转了某些人的操作(赞变蜡烛 或者 蜡烛变成赞 ...