不走修改是怎么回事啊
点击修改超链接,不执行修改操作(修改操作在本页执行)
<form name= "myform " method= "Post " action= "mgrzhaopin_show_new.asp?action=modify ">
……
<a href= "mgrzhaopin_show_new.asp?Action=modify&id= <%=rs( "id ")%> "> 修改 </a>
<%
action=request ( "Action ")
select case action
case "Modifysave " call savemodify()
case else call showContent
end select
%>
sub Modify()
dim ID
ID=trim(Request( "ID "))
if ID= " " then
FoundErr=1
ErrMsg=ErrMsg & " <br> <li> 请指定要修改的招聘信息 </li> "
exit sub
else
ID=Clng(ID)
end if
sql= "select * from select_info where parent_id=0 "
Set rs=Server.CreateObject( "Adodb.RecordSet ")
rs.Open sql,conn,1,3
%>
<form method= "post " action= "mgrzhaopin_show_new.asp " name= "form1 " onSubmit= "javascript:return checkadd(); ">
<table width= "47% " border= "0 " align= "center " cellpadding= "2 " cellspacing= "1 " class= "border " >
<tr bgcolor= "#6666FF " class= "title ">
<td height= "22 " colspan= "2 "> <div align= "center "> <font size= "2 "> <strong> 修 改 招 聘 信 息 </strong> </font> </div> </td>
</tr>
<tr>
<td width= "16% " class= "tdbg "> <strong> 职 位: </strong> </td>
<td width= "84% " class= "tdbg "> <%=rs( "zhiwei ")%> <input name= "ID " type= "hidden " value= " <%=rs( "ID ")%> "> </td>
</tr>
<tr>
<td width= "16% " class= "tdbg "> <strong> 所属部门: </strong> </td>
<td width= "84% " class= "tdbg "> <select name= "bumen " id= "bumen ">
<% do while not rs.eof %>
<option value= " <%=rs( "select_value ")%> "> <%=rs( "select_value ")%> </option>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
</select> </td>
</tr>
<%
response.Write(sql)
response.End()
%>
<tr>
<td width= "16% " class= "tdbg "> <strong> 人 数: </strong> </td>
<td width= "84% " class= "tdbg "> <select name= "num_people " id= "num_people ">
<option value= "1 "> 1 </option>
<option value= "2 "> 2 </option>
<option value= "3 "> 3 </option>
<option value= "4 "> 4 </option>
<option value= "5 "> 5 </option>
<option value= "6 "> 6 </option>
<option value= "7 "> 7 </option>
<option value= "8 "> 8 </option>
<option value= "9 "> 9 </option>
<option value= "10 "> 10 </option>
</select>
人 </td>
</tr>
<tr>
<td width= "16% " class= "tdbg "> <strong> 学 历: </strong> </td>
<td width= "84% " class= "tdbg "> <select name= "xueli " id= "xueli ">
<option value= "高中以下 "> 高中以下 </option>
<option value= "高中 "> 高中 </option>
<option value= "大专 "> 大专 </option>
<option value= "本科 "> 本科 </option>
<option value= "硕士 "> 硕士 </option>
<option value= "博士 "> 博士 </option>
</select> </td>
</tr>
<tr>
<td width= "16% " class= "tdbg "> <strong> 性 别: </strong> </td>
<td class= "tdbg "> <select name= "sex " id= "sex ">
<option value= "不限 "> -不限- </option>
<option value= "男 "> 男 </option>
<option value= "女 "> 女 </option>
</select> </td>
</tr>
<tr>
<td width= "16% " class= "tdbg "> <strong> 工作经验: </strong> </td>
<td class= "tdbg "> <select name= "year_exp " id= "year_exp ">
<option value= "0 "> 无 </option>
<option value= "1 "> 1年 </option>
<option value= "2 "> 2年 </option>
<option value= "3 "> 3年 </option>
<option value= "4 "> 4年 </option>
<option value= "5 "> 5年 </option>
<option value= "6 "> 6年 </option>
<option value= "7 "> 7年 </option>
<option value= "8 "> 8年 </option>
<option value= "9 "> 9年 </option>
<option value= "10 "> 10年 </option>
</select> </td>
</tr>
<tr>
<td colspan= "2 " align= "center " class= "tdbg "> <input name= "Action " type= "hidden " id= "Action " value= "Modifysave ">
<input type= "submit " name= "Submit " value= "保存修改结果 " style= "cursor:hand; ">
<input name= "Cancel " type= "button " id= "Cancel " value= " 取 消 " onClick= "window.location.href= 'mgrzhaopin_show_new.asp ' " style= "cursor:hand; "> </td>
</tr>
</table>
</form>
<%
rs.close
set rs=nothing
endsub
sub savemodify()
dim Bumen,Zhiwei,Xueli,Year_exp,Age_down,Age_up,Sex,Num_people,Obligation,Demo_other,Treatment,Creat_time
bumen=request( "bumen ")
zhiwei=trim(request( "zhiwei "))
xueli=request( "xueli ")
year_exp=request( "year_exp ")
sex=request( "sex ")
set rs=server.CreateObject( "adodb.recordset ")
sql= "select Bumen,Zhiwei,Xueli,Year_exp from Zhaopin_info where id= " & ID
Set rs=Server.CreateObject( "Adodb.RecordSet ")
rs.Open sql,conn,1,3
if rs.Bof and rs.EOF then
FoundErr=1
ErrMsg=ErrMsg & " <br> <li> 不存在此招聘信息! </li> "
rs.close
set rs=nothing
exit sub
end if
rs( "bumen ")=bumen
rs( "zhiwei ")=zhiwei
rs( "num_people ")=num_people
rs( "xueli ")=xueli
rs( "sex ")=sex
rs.update
rs.Close
set rs=Nothing
call showContent
end sub
%>
[解决办法]
<%
action=request ( "Action ")
select case action
case "Modifysave " call savemodify()
case else call showContent
end select
%>
' '这一段建议放在页面的最开始
sub Modify()
dim ID
ID=trim(Request( "ID "))
if ID= " " then
FoundErr=1
ErrMsg=ErrMsg & " <br> <li> 请指定要修改的招聘信息 </li> "
exit sub
else
ID=Clng(ID)
end if
sql= "select * from select_info where parent_id=0 "
Set rs=Server.CreateObject( "Adodb.RecordSet ")
rs.Open sql,conn,1,3
%>
这一段sub Modify()怎么没有用 <%%> 括起来?
还有一个始终想不明白的问题,既然用了链接+asp参数,为什么还要用 <form> 来执行“修改”呢?