📄 form.jsp~7~
字号:
<%@ page contentType="text/html; charset=big5" %>
<html>
<head>
<title>
NOTE BOOK
</title>
<script src=convert.js></script>
<script>
function check(fm)
{
//------check name
var str_name = fm.g_name.value;
if(isSpace(str_name))
{
alert("Please neter your name !");
fm.g_name.focus();
return false;
}
else
{
var patrn = /^[^`~!@#$%^&*()|?+=/<>;,":{\[\]}]{1,10}$/;
if(patrn.exec(str_name))fm.g_name.value = convert(str_name);
else
{
alert("Name should not include especial character !");
fm.g_name.focus();
return false;
}
}
//---------check gender
if(!fm.g_sex[0].checked && !fm.g_sex[1].checked)
{
alert("Please choose your gender !");
fm.g_sex[0].focus();
return false;
}
//------check qq
var str_qq = fm.g_qq.value;
if(!isSpace(str_qq))
{
var patrn = /^[0-9]{1,15}$/;
if(!patrn.exec(str_qq))
{
alert("Your qq should be a number !");
fm.g_qq.focus();
return false;
}
}
//------check E_mail
var str_mail = fm.g_mail.value;
if(!isSpace(str_mail))
{
var patrn = /^\w{1,20}@\w{2,15}\.(com|net|org|edu)(|\.[a-zA-Z]{2,5})$/;
if(!patrn.exec(str_mail))
{
alert("Your e_mail should be true !");
fm.g_mail.focus();
return false;
}
}
//------check title
var str_title = fm.g_title.value;
if(isSpace(str_title))
{
alert("Please write a title for your words !");
fm.g_title.focus();
return false;
}
else
{
fm.g_title.value = convert(str_title);
}
//------check age
var str_age = fm.g_age.value;
if(!isSpace(str_age))
{
var patrn = /^[0-9]{1,2}$/;
if(!patrn.exec(str_age))
{
alert("Your age should be a number !");
fm.g_age.focus();
return false;
}
}
//------check content
var str_content = fm.g_content.value;
if(isSpace(str_content))
{
alert("Your content should not be null !");
fm.g_content.focus();
return false;
}
else
{
fm.g_content.value = convert(str_content);
}
alert(fm.g_content.value);
return true;
}
</script>
</head>
<body bgcolor="#ffffff">
<br>
<h1 align="center">
NOTE BOOK
</h1>
<hr width="70%">
<form method="post" name=f1 action="insert.beyondplus" onsubmit="return check(this);">
<table width="85%" align="center" border="1" cellpadding="10" cellspacing="0" bgcolor="#aaaaaa" bordercolor="#eeeeee">
<tr>
<td width="30%" align="right"><font color="red">*</font>name</td>
<td><input type="text" name="g_name" maxlength="10"></td>
</tr>
<tr>
<td align="right"><font color="red">*</font>boy or girl</td>
<td>boy:<input type="radio" name="g_sex" value="1">
girl:<input type="radio" name="g_sex" value="0">
</td>
</tr>
<tr>
<td align="right">qq</td>
<td ><input type="text" maxlength="15" name="g_qq"></td>
</tr>
<tr>
<td align="right">E_mail</td>
<td><input type="text" maxlength="50" name="g_mail"></td>
</tr>
<tr>
<td align="right"><font color="red">*</font>title</td>
<td><input type="text" maxlength="50" name="g_title"></td>
</tr>
</tr>
<tr>
<td align="right">age</td>
<td><input maxlength=3 name="g_age"></td>
</tr>
<tr>
<td align="right"><font color="red">*</font>content</td>
<td><textarea rows="4" cols="50" name="g_content" maxlength="500"></textarea></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="Submit" value="Submit" style="width:80">
<input type="reset" value="Reset" style="width:80"></td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -