Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

sekihin

Asp get checkbox value

// description of your code here

For i=1 To Request.Form("Checkbox1").Count   
	If Request.Form("Checkbox1")(i)<>"" Then   

	End If   
Next

Asp get checkbox value

// description of your code here

		If Request.Form("checkbox1") <> "" Then
			For Each loopIndex in Request.Form("checkbox1")
				If loopIndex<>"" Then
					'Do something
				End if
			Next
		End if

asp try catch

// description of your code here

on error resume next
If err.number<>0 Then
End If

SqlServer yyyy/MM/dd

// description of your code here

convert(datetime,convert(nvarchar,H.ReceiveDate ,111),120)

Check all checkbox in the form

// description of your code here

<SCRIPT LANGUAGE="JavaScript">
function checkAll() {
    var theForm, z = 0;
    theForm = form_1;
     for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox'){
      theForm[z].checked = true;
      }
    }
}
 
function uncheckAll() {
    var theForm, z = 0;
    theForm = form_1;
     for(z=0; z<theForm.length;z++){
      if(theForm[z].type == 'checkbox'){
      theForm[z].checked = false;
      }
    }
}
</SCRIPT>

Request access to select the object through each value

// description of your code here

s=request("selectname")   
sArr=split(s,",",")   
for   i=0   to   ubound(sArr)   
    response.write   sArr(i)   &   "<br>"   
next   

get_next_month

// description of your code here

function get_next_month($date) {
	$date = str_replace("/", "-", $date); 
	$year=date("Y",strtotime($date));
	$month=date("n",strtotime($date)) + 1;
	if ($month == 13) {
		$month = 1;
		$year++;
	}
	$day = date("t", mktime(0, 0, 0, $month, 1, $year));
	return date("Y/m/d", mktime(0, 0, 0, $month, $day, $year));
}

get_previous_month

// description of your code here

function get_previous_month($date) {
	$date = str_replace("/", "-", $date); 
	$year=date("Y",strtotime($date));
	$month=date("n",strtotime($date)) - 1;
	if ($month == 0) {
		$month = 12;
		$year--;
	}
	return date("Y/m/d", mktime(0, 0, 0, $month, 1, $year));
}