Daily Archives: September 5, 2010

Enabling javascript in browsers


To enable java script in you browser, please follow the instructions below: Internet Explorer (6.0) 1. Select ‘Tools’ from the top menu 2. Choose ‘Internet Options’ 3. Click on the ‘Security’ tab 4. Click on ‘Custom Level’ 5. Scroll down

Posted in JavaScript

Empty Validation in JavaScript


function checkNullField() { var field1 = document.formName.fieldName.value; if(field1 == ”) { alert(“Field Name is empty”); return false; } else { return true; } }

Posted in JavaScript

Decimal Validation in JavaScript


function MoneyValidation() { var value1 = document.formaName.fieldName.value; if(value1.indexOf(“.”) != -1) { if(!/\.[0-9]{1,2}$/.test(value1)) { alert(“value1 should be two fractional positions required”); return false; } } return true; }

Posted in JavaScript

Numeric Validation in javaScript


var isNS4 = (navigator.appName==”Netscape”)?1:0; function checkCharacter(event){ if(!isNS4){ if(event.keyCode == 8 || event.keyCode == 0 ) return true; if(event.keyCode < 46 || event.keyCode > 57 ) { event.returnValue = false; } } else{ if(event.which == 8 || event.which == 0 )

Posted in JavaScript

Email Validation in Javascript


function validateEmail(obj) { var fld=0; var goodEmail = obj.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi); fld = obj; if (goodEmail) { good = true } else { alert(“Please enter a valid email address.”) setTimeout(“fld.focus();”,1); setTimeout(“fld.select();”,1); good = false } return good; } The above

Posted in JavaScript

Creation of Dynamic rows in javascript


Create a html file with this code and check the functionality: <html> <head> <script LANGUAGE=”JavaScript”> function addRow(tableID){ var table = document.getElementById(tableID); var rowCount = table.rows.length; var row = table.insertRow(rowCount); var cell1 = row.insertCell(0); var element1 = document.createElement(“input”); element1.type = “text”;

Posted in JavaScript

Conversion of string into uppercase


The below function is used to convert the alphabets into uppercase function convertToUpper(){ var field1 = document.formName.elementName field1.value = field1.value.toUpperCase(); } Example : If the formName is StudentForm and element name is student id like stud100 Then , function convertToUpper(){

Posted in JavaScript

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 679 other followers

Calendar
September 2010
M T W T F S S
« Aug   Oct »
 12345
6789101112
13141516171819
20212223242526
27282930  
Mallikarjun Gunda

This is Mallikarjun Gunda, I am working as a software professional. Blogging is my Passion. This blog contains the posts on Java related technologies and programming languages. I am happy to share my knowledge through the blogs.

Blog Stats
  • 321,749 hits
IndiBlogger
malliktalksjava.wordpress.c...
70/100