ASP Development Skills Collection (4)

Source: Internet
Author: User
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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.