Tuesday, May 20, 2014

Force Alpha And Numeric Only jQuery

You could try this extension:

jQuery.fn.ForceAlphaNumericOnly = function() {
    return this.each(function() {
      	$(this).keydown(function(e) {
	var key = e.charCode || e.keyCode || 0;
	// allow backspace, tab, delete, arrows,letters, numbers and keypad numbers ONLY
	return (
	  key == 8 || 
	  key == 9 ||
	  key == 46 ||
	  key == 32 ||
	  (key >= 37 && key <= 40) ||
	  (key >= 48 && key <= 57) ||	
	  (key >= 65 && key <= 90) || 
	  (key >= 96 && key <= 105));
	})
     })
};
Useage:
<input type="text" class="span10 requiredfield" value="" id="contact-phone" name="contact-phone"> 

Working Demo

Galaxy S4 not support CSS3 border-radius

Here code for fixed issue on Galaxy S4

border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;