Monday, January 30, 2012

Check validate webaddress using javascript reg expression


web = 'your web address';
var aweb = ignoreSpaces(web);
var filterweb = /^([A-Za-z0-9_\-\.])+([A-Za-z0-9_\-\.]{2,4})+\.([A-Za-z]{2,4})$/;
if(filterweb.test(aweb)){
        alert('correct')
    }
    else{
       alert('incorrect')
    }
try this for javascript

Bind Some Event to Element and trigger that function when click the element

Scenario: Suppose if we used same click event function in various web pages. if you want do some logic some page button for that need to re...