[jQuery] onlyAllow class: Extendable with your own "allows"...
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Tahoma">Hey,
Inspired by Sam's numeric function i started on porting some of my own
functions to jQuery-ish code. I've made a class called "onlyAllow"
which is used by 2 plugins i wrote for jQuery called:
- $.fn.onlyDigits() --> Basicly thesame as Sam's numeric
functionality
- $.fn.onlyMoney() --> Allows only money to be entered and formats
the field on blur.
If you have an input element and you only want money to be entered
there, you could simply do:
$('#code').</font></font><font size="-1"><font face="Tahoma">onlyMoney</font></font><font
size="-1"><font face="Tahoma">();
You could also write your own functions for postal codes, phone numbers
etc. You could even write some input masking functionality in the
callback function.
* This code requires the latest SVN to work, example is attached. *
-- Gilles
</font></font>
</body>
</html>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/