每个人我都是 ASP 的新手,我写了一个应该从 HTML 表单中获取输入的代码。
我给了一个文本框,该文本框的值是强制性的。如果用户没有输入该字段。asp 页面应显示消息“该字段不能留空! ”
我写了一个代码,但我没有得到输出。谁能帮我?
我的代码片段是
索引.html
<form method="post" action="a1.asp">
Field 1<input type="text" name="field1">*
</br></br><input type="submit" name="send" value="submit">
<input type="reset" name="clear" value="clear">
</form>
a1.asp
<%
Function Mandatory(field1)
if field1 = "" then
response.write("Field one is mandatory!cannot be left empty")
else
response.write("Welcome to new html")
End if
End Function
%>