日期:2014-05-16  浏览次数:20329 次

增加一个表格检查!
想增加一个qemail的表格检查,自己增加了一个i2   ,就出错了。。
应该怎么改???

<script   language=vbscript>
function   checkfeed()
i1=quest.qname.value
i2=quest.qemail.value
i3=quest.question.value
if   i1= " "   then
msgbox "请填写您称呼! "
quest.qname.focus
if   i2= " "   then
msgbox "请填写您电话! "
quest.qemail.focus
elseif   i3= " "   then
msgbox "请填写留言内容! "
quest.question.focus
elseif   len(i3)> 300   then
msgbox "对不起,留言内容不能超过300个字! "
quest.question.focus
else
quest.submit
end   if
end   function
</script>

<form   name= "quest "   method= "post "   action= "Message_pass.asp ">
<tr>
<td   width= "76 "   align= "center "   bgcolor= "B9E0F7 "> 您的姓名: </td>  
<td   width= "419 "   bgcolor= "B9E0F7 ">  
<input   name= "qname "   type= "text "   class= "name "   id= "qname "   size= "25 "   maxlength= "10 "> </td>
<p>
</tr>
<tr>
<td   align= "center "   bgcolor= "B9E0F7 "> 您的电话: </td>
<td   bgcolor= "B9E0F7 ">
<input   name= "qemail "   type= "text "   class= "qemail "   id= "qemail "   size= "25 "   maxlength= "20 "> </td>
</tr>
<tr>
<td   align= "center "   bgcolor= "B9E0F7 "   valign= "top "> </p>
<p> 请写内容: </td>  
<td   bgcolor= "B9E0F7 "   width= "419 "> <textarea   name= "question "   cols= "50 "   rows= "10 "   class= "nr "   id= "question ">
</textarea> </td>
</tr>
<tr>  
<td   colspan= "2 "   align= "center "   bgcolor= "B9E0F7 ">    
<input   name= "ddd "   type= "button "   class= "pass "   onClick= "checkfeed() "   value= "提   交 "> </td>
</tr>
</p>
</form>
</table>


------解决方案--------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN ">
<html>
<head>
<title> New Document </title>
<meta name= "Generator " content= "EditPlus ">
<meta name= "Author " content= " ">
<meta name= "Keywords " content= " ">
<meta name= "Description " content= " ">
</head>

<body>
<script language=vbscript>
function checkfeed()
i1=quest.qname.value
i2=quest.qemail.value
i3=quest.question.value
if i2 = " " then
msgbox "请填写您电话! "
quest.qemail.focus
elseif i3 = " " then
quest.question.focus
elseif len(i3)> 300 then
msgbox "对不起,留言内容不能超过300个字! "
quest.question.focus
end if
end function
&l