<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
function validate(){
function validate(){
//一
.是通过jDOM
// var attitudeObj = document.getElementById("attitude");
//var attitude = attitudeObj.innerHTML;
// var attitudeObj = document.getElementById("attitude");
//var attitude = attitudeObj.innerHTML;
//二
.是通过jquery
var att = $("#attitude").text();//可以得到输入域中的内容
var idnum = $("#idnum").val();
var att = $("#attitude").text();//可以得到输入域中的内容
var idnum = $("#idnum").val();
var name = $("#name").val();
var t_name = $("#t_name").val() ;
var pro_name = $("#pro_name").val() ;
// alert(att);
if( name == null || name == "" ){
alert("请输入毕业设计名称!");
return false;
}
att = att.replace(/\s+/g,"");
if( att == null || att == ""){
alert("请输入选题须知!");
return false;
}
if( t_name == null || t_name == "" ){
alert("请选择教师!");
return false;
}
if( pro_name == null || pro_name == ""){
alert("请选择专业!");
return false;
}
location="teacher/mainfra.jsp";
//location="teacherAction_AddGraduationTitle.action?idnum=" + idnum +"&cname=" + cname +"&start=" + start+"&end=" + end;
return true;
}
</script>
</head>
<body">
<div >
<div style="margin-left: 100px;">
<!-- <form action="teacherAction_AddGraduationTitle.action" method="post" >-->
<span>自动编号:</span><input type="text" readonly="readonly" name="idnum" id="idnum" style="background: gray;" value="<s:property value="#request.maxIdnum"/>"/><br/>
<br/>
<span>毕业设计名称:</span><input type="text" name="name" id="name"/><br/><br/>
<span>所属教师:</span><select name="t_name" id="t_name">
<option></option>
<s:iterator value="teacherList">
<option value="<s:property value='idnum' />"><s:property value="name" /></option>
</s:iterator>
</select> <br/> <br/>
<span>所属专业:</span><select name="pro_name" id="pro_name">
<option></option>
<s:iterator value="professionList">
<option value="<s:property value='idnum' />"><s:property value="pro_name" /></option>
</s:iterator>
</select>
<br/>
<br/>
<span>选题须知:</span>
<textarea id ="attitude" name="attitude" rows="3" cols="30" style="color: red;">
</textarea>
<br/>
<br/>
<input type="button" value="添加"> <input style="margin-left: 100px" type="reset" value="重置">
<!-- </form> -->
</div>
</div>
</body>