UK Postcode Validation

Regular expression for JavaScript var regPostcode = /^([a-zA-Z]){1}([0-9][0-9]|[0-9]|[a-zA-Z][0-9][a-zA-Z]|[a-zA-Z][0-9][0-9]|[a-zA-Z][0-9]){1}([ ])([0-9][a-zA-z][a-zA-z]){1}$/; var result = regPostcode.test(SearchTerm); if (!result) { alert(“Please enter valid postcode”); return false; } Regular expression for C# string regPostcode = “([a-zA-Z]){1}([0-9][0-9]|[0-9]|[a-zA-Z][0-9][a-zA-Z]|[a-zA-Z][0-9][0-9]|[a-zA-Z][0-9]){1}([ ])([0-9][a-zA-z][a-zA-z]){1}”; System.Text.RegularExpressions.Regex regx = new System.Text.RegularExpressions.Regex(regPostcode); if(!regx.IsMatch(address0.PostalCode)) { results.Add(new ValidationResult(String.Format(“Please enter valid postcode for {0}.”, addressRank))); } You can check the regular expression at http://www.regexplanet.com/ …

Add Comma into number using javascript

<script> addCommas = function(input){ // If the regex doesn’t match, `replace` returns the string unmodified return (input.toString()).replace( // Each parentheses group (or ‘capture’) in this regex becomes an argument // to the function; in this case, every argument after ‘match’ /^([-+]?)(0?)(\d+)(.?)(\d+)$/g, function(match, sign, zeros, before, decimal, after) { // Less obtrusive than adding ‘reverse’ method …

Telerik RadList Box Checkbox Items check all or uncheck all

Aspx page: I bound the lstLocations dynamically. So it look like as below. <telerik:RadListBox ID=”lstLocations” runat=”server” CheckBoxes=”true” Width=”520px” Height=”130px”> </telerik:RadListBox> // Select All checkbox buttons <asp:CheckBox CssClass=”CBFull” ID=”chkSelectAll” runat=”server” Text=”Select All” onclick=”javascript:return ToggleAllLocations(this);” /> // Add below function in javascript function function ToggleAllLocations(checkBox) { //ctl00_ContentPlaceHolder1_RadDockLocFilter_C_lstLocations is a client id of radlistbox var listbox = $find(“ctl00_ContentPlaceHolder1_RadDockLocFilter_C_lstLocations”); …

How to read RSS feed using Jquery

Click here download latest plugin Getting Started First include the jQuery and zRSSFeed libraries. <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js” type=”text/javascript”></script> <script src=”jquery.zrssfeed.min.js” type=”text/javascript”></script> Add a DIV tag where you wish the feed to display and give it an ID. There is no need to specify a class, this will be added. <div id=”test”></div> Now add the script to …

Send free SMS API

http://ubaid.tk/api-usage/ Required Params : uid, pwd, phone, msg. uid : your userid for the required sms provider pwd : your password for the required sms provider provider : way2sms(default), fullonsms, smsindia, whozzat, smsinside, site2sms. if you do not specify any provider, way2sms will be used by default. phone : phone number whom you want to …

jQuery Beginners Guide

Adding jQuery to your Page jQuery is a client script library and so you have to add a script reference to your page. You can download the latest version of jQuery from the jQuery site at www.jQuery.com. Here are many ways that you can include jQuery into your page: 1. Reference a local copy via …