跳到主要內容

發表文章

[jQuery]JQuery Validation and Ajax

imports jquery.min.js imports jquery.validate.min.js [Ajax] function callAjax(){ $.ajax({type: "POST", url: "ajax.asp", data: {fun: "checkCardNO", CardNo: $("#CardNo").val()}, dataType:"html", success:function(msg){ $("#AjaxValue").val(msg); /* Use Hidden input or div to transfer Ajax Value */ } }) } [Form Validation] --Add Validation Function $.validator.addMethod("checkRegisterd", function(value, element) { callAjax(); if($("#AjaxValue").val()=="Unregisted") return true; } ); $.validator.addMethod("Useless", function(value, element) { callAjax(); if($("#AjaxValue").val()!="noData") return true; } ); --Validation $().ready(function() { $("#form1").validate({ rules: { CardNo: { required: true, Useless: true, checkRegisterd: true }, Name: "required", Tel: { require...

Autoruns for Windows v10.07

An useful software. Autoruns for windows Introduction This utility, which has the most comprehensive knowledge of auto-starting locations of any startup monitor, shows you what programs are configured to run during system bootup or login, and shows you the entries in the order Windows processes them. These programs include ones in your startup folder, Run, RunOnce, and other Registry keys. You can configure Autoruns to show other locations, including Explorer shell extensions, toolbars, browser helper objects, Winlogon notifications, auto-start services, and much more. Autoruns goes way beyond the MSConfig utility bundled with Windows Me and XP.

JQuery Select Sample

JavaScript <script language="javascript" src="js/jquery-1.5.2.min.js"></script> <script language="javascript" > function ShowSelect() { $("select#Label option:selected'").each(function(){ $("#selectedItem").append(this); }); } </script> HTML: <select name="Label" size="15" multiple="multiple" id="Label"> <option value="1">1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> </select> <input type="button" name="select" value="select" onClick="ShowSelect();" > <select name="selectedItem" id="selectedItem...

[C#]Determine Whether a String Represents a Numeric Value

TryParse for Int32, long, byte , and decimal return Boolean Int32.TryParse( s as String, ref i as int32) [VB] Int32.TryParse(String s, out int32 i) [C#] long.TryParse( s as String, ref i as int32) [VB] long.TryParse(String s, out int32 i) [C#] int32.TryParse(s, out i) http://msdn.microsoft.com/zh-tw/library/bb384043.aspx

T-SQL Cursor Loop Sample

GO DECLARE @value1 varchar(50) DECLARE @value2 varchar(50) DECLARE my_cursor CURSOR FOR SELECT Value1,value2 FROM TableName OPEN my_cursor FETCH NEXT FROM my_cursor INTO @value1,@value2 WHILE @@FETCH_STATUS = 0 BEGIN print @value1 + ':' + @value2 /*Main Process Start*/ FETCH NEXT FROM my_cursor INTO @value1,@value2 end CLOSE my_cursor DEALLOCATE my_cursor