Thursday, January 05, 2006

Charactor Validatin : Java Script

//
//A funtion for check a charactor input in a web form
//
function checkIt(evt) {
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode
    if ((charCode < 45 || charCode > 57) && charCode != 8 && charCode != 37 && charCode != 39) {
        alert("This field accepts numbers only")
        return false
    }
    return true
}
//
// you can access it from any contorl as follows
//
onKeyPress = 'javascript:return checkIt(event)'

1 comment:

Indika said...

Ohh man, i think you hve spend too much time infront of PC. Hay common, wake up, Im going to use try catch, so that they will, never going to crash, at lest i have a control over that. :)

Azure Storage Account Types

Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...