📄 continue.jsp
字号:
<!-- This is goon.jsp, included by several jsp files.
the only jsp code places the msgtext String into a
textarea, as the starting point for a message.
we use javascript to check parameters in an onsubmit.
logout needs no other data;
dodb needs a dbOperation (possibly with Parameter1, ..)
send needs smtphost,retaddr,toaddr,subject,msgtext;
the first two were set in the initial html page.
-->
<script>
var argCount={LOOKUPFROMWHEN:1,LOOKUPFROMWHO:1,ADD:3,DELETE:1};
function onsub(){
var theForm=window.document.theForm;
var theCmd=theForm.bbcmd.value;
if(theCmd=="logout")return true;
if(theCmd=="send") return sendOk(theForm);
return doDBOk(theForm);
}
function sendOk(theForm){
if(""==theForm.toaddr.value)
{alert("must fill in toaddress");return false;}
if(""==theForm.subject.value)
{alert("must fill in subject");return false;}
return true;
}
function doDBOk(){
var theOp=theForm.dbOperation.value;
var N=argCount[theOp]; if(!N)N=0;
theForm.ParameterMax.value=N;
for(var i=1;i<=N;i++)
if(""==theForm["Parameter"+i].value)
{alert("must fill in Parameter"+i);return false;}
if(theOp=="BIRTHDAYLIST") // param passed as "when"
theForm.when.value=theForm.Parameter1.value;
return true;
}
</script>
<form name="theForm" action="birthday.jsp"
method="post" onsubmit="return onsub()">
<input type=hidden name=ParameterMax value="0">
<input type=hidden name=when>
To Do:
<select name=bbcmd size=1>
<option value="dodb" selected>doDB Op</option>
<option value="send">send message</option>
<option value="logout">logout</option>
</select>
Database Op:
<select name=dbOperation size=1>
<option value="LOOKUPALL" selected>show the table</option>
<option value="BIRTHDAYLIST">birthday list for yyyy-MM-dd date</option>
<option value="LOOKUPFROMWHEN">look up a specific date</option>
<option value="LOOKUPFROMWHO">look up a specific person</option>
<option value="ADD">add a (who,when,addr) entry in dbase</option>
<option value="DELETE">delete a person (by name)</option>
</select>
<br><input type=submit>
<br>
Parameters for DB Queries:
<input type=text name=Parameter1 size=10 value="">
<input type=text name=Parameter2 size=10 value="">
<input type=text name=Parameter3 size=10 value="">
<br>
Or you can send mail. <br>
Send to: <input type=text name=toaddr value="" size=20>
about: <input type=text name=subject value="" size=20>
<br>
<textarea name=msgtext rows=10 cols=50>
<%= msgtext %>
</textarea>
</form>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -