// numeric extension
jQuery.fn.onlyNumeric = function () {
return this.each(function () {
$(this).keydown(function (e) {
var key = e.which || e.keyCode;
if (!e.shiftKey && !e.altKey && !e.ctrlKey &&
key >= 48 && key <= 57 || key >= 96 && key <= 105 ||
key == 8 || key == 13 || key == 46 ||
key == 35 || key == 36 || key == 37 || key == 39)
return true;
return false;
});
});
};
// use it in your input text box
$('#input_box').onlyNumeric();
A expert on system architect with full SDLC and Agile development experience. Skills: , C# C++ Scrum OOA/OOD javascript ASP.Net MVC XML, HTML Web Service, RESTful, WCF, Android and etc. Email me if you need help on development.
Tuesday, 8 November 2011
JQuery extension: numeric only input text
Here is the simply but re-usable approach, IMO: create an jquery numeric extension and then use the numeric extension in your input text box:
Labels:
javascript
Subscribe to:
Post Comments (Atom)
An ios course introduces Apple application development fundamentals step by step. It simplifies Swift syntax and interface design concepts. This ios course focuses on practical implementation. It improves logical thinking and coding accuracy. Learners gain hands-on experience. It is dependable.
ReplyDeleteSales force developer training focuses on building custom CRM solutions and integrating enterprise applications. It explains REST and SOAP API integrations clearly. This sales force developer training enhances application development and integration expertise. Learners build real-time projects. Security implementation is included. Best practices are covered. It prepares job-ready professionals.
ReplyDeleteSalesforce Developer Training
ReplyDeleteSalesforce developer training salesforce developer training provides hands-on experience in application development. It covers key tools and techniques. Learners gain confidence through projects. The training boosts job opportunities. Perfect for developers.