Skip to main content

Posts

Javascript function to validate html select or drop down list

Introduction: In my previous article I have explained about Code used to How to show confirmation message while deleting grid view row . In this article I am going to explain about how validate drop down list or html select using Javascript . Explanation: For the explanation purpose I have a select list which contains city list along with select city as items. While clicking on the button it will check the selected index of the select. If it is 0 then it will show the alert as city is not selected. Else it will show the message as city is selected.

How to show confirm message while deleting grid view row.

Introduction: In my previous article I have explained about Code used to How to generate random strings/passwords using c#.net . In this article I am going to explain about how to show the confirmation message while deleting the row from the grid view using c#.net . Explanation: For the explanation purpose I have created table with cities named tempCities and created two procedures one for inserting and another one for deleting.

How to create Generate random string using C#.Net, Asp.Net |Code to generate random password using C#.Net, Asp.Net

Introduction: In my previous article I have explained about Code used to Convert numbers into words using C#.net . In this article I am going to explain about code used to create zip, rar and gzip files using c#.net or how to compress and decompress data using c#.net . Explanation: This method is used to generate random string. You can this method to generate random passwords of specified length. For explanation purpose I have a form with a textbox to enter no of characters to generate random string. When you click on the generate button it will automatically generates the random string of specified length.

How to create zip, rar and gzip files using C#.Net, Asp.Net |Code to Compress Decompress files using C#.Net, Asp.Net

Introduction: In my previous article I have explained about Code used to Convert numbers into words using C#.net . In this article I am going to explain about code used to create zip, rar and gzip files using c#.net or how to compress and decompress data using c#.net . Explanation: This method is used to generate random string. You can this method to generate random passwords of specified length. For explanation purpose I have a form with a textbox to enter no of characters to generate random string. When you click on the generate button it will automatically generates the random string of specified length.

Code To Convert rupees(numbers) into words using C#.Net

Introduction: In my previous article I have explained about how to validate emailid using javascript . In this article I am going to explain about code used to convert rupees(numbers) into words using C#.Net . Explanation: For explanation purpose I have a page. It has a textbox to input the numbers. And when you click on the convert to words button then it will convert the input numbers into words and shows it in the below label. Below is the C# code used to do this functionality. public static string NumbersToWords( int inputNumber) {     int inputNo = inputNumber;     if (inputNo == 0)         return "Zero" ;     int [] numbers = new int [4];     int first = 0;     int u, h, t;     System.Text. StringBuilder sb = new System.Text. StringBuilder ();     if (inputNo < 0)     { ...

Javascript code/function to validate email id | Check Emailid is Valid

Introduction: In my previous article I have explained about How to Valiate radio button using javascript . In this article I am going to explain about code used to validate emailed using   Javascript . Explanation: For explanation purpose  I have a text input and a button in the form. If you enter the emailid and click the validate button then it will check whether it is a valid email id or not. If it is valid email id then it will show the alert msg as Valid Emailid else it will show alert msg as Invalid Emailid. Below is the javascript function to validate email id. It gets the textbox  id as input. function fnCheckEmail(id) {     var emailid = document.getElementById(id).value;     var emailfilter = /^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$$/i     if (emailfilter.test(emailid)) {         alert(emailid+ ' is a Valid EmailId..' );   ...

Javascript code/ function to validate Radio Button | Check Radio button is checked

Introduction: In my previous article I have explained about Code used to validate emailid using javascript. In this article I am going to explain about  How to remove html tags from the input string Explanation: For explanation purpose I have two radio buttons with name “gender”. While clicking on the validate button I am checking whether any one gender is selected. Below is the javascript code used to validate the radio button. function fnCheckRadio(name) {     var flag = "0" ;     var objs = document.getElementsByName(name);     if (objs) {         if (objs.length > 0) {             for ( var i = 0; i < objs.length; i++) {                 if (objs[i].checked == true ) {           ...