Skills
confirm Operation
function Confirmdel ()
{
if (confirm) are you sure you want to delete it? Once deleted will not be restored! "))
return true;
Else
return false;
}
<form name= "del" method= "Post" action= "del.asp" >
==============================================================
I use one myself.
function Confirmreset ()
{
if (Confirm (OK) cancel operation? Once the cancellation operation will not be restored! "))
Window.form1.reset ();
return true;
}
<a href= "Javascript:confirmreset ();" ></a>
indexOf () usage
< string Object >.indexof (< Another string object >[, < start position]);
This method looks for < Another string object > from < string object > (if it gives the < start position > to ignore the previous position), if found, returns its position and returns "1" without finding it. All the "locations" are zero-based.
eg. Str.indexof ("AP") >-1 description of "AP" string in str
Generate flow number
<%
If Request.Form ("MODF") <> "" Then
Dim RS
Dim SQL
Dim BugID
Dim today
Today=date ()
Toyear=year (today)
toyear=toyear*10000
Tomonth= Month (today)
tomonth=tomonth*100
Tonow=day (today)
Serialnum = toyear + tomonth + tonow
Serialnum = serialnum*10000+1
Set rs = Server.CreateObject ("Adodb.recordset")
sql = "SELECT top 1 * ' buglist ORDER by submitdate Desc"
Rs.Open sql,conn,1,3
If not rs.eof then
Dim Oldserialnum
Oldserialnum = Rs ("BugID")
Oldserialnum = Right (oldserialnum,12)
Serial = Right (serialnum,12)
If oldserialnum-serial >= 0 Then
Serialnum = oldserialnum + 1
End If
End If
BugID = "ES" &request ("productversion") &serialnum
Response to carriage return
function GetData (What,whatid)
{
if (event.keycode==13)
......
<input name= "serialnum<%=i%>" type= "text" >
Refresh the parent page before closing the window
Response.Write "<script language = javascript>"
Response.Write "Javascript:opener.location.reload ();"
Response.Write "Javasript:window.close ();</script>"
[1] [2] [3] Next page