If you are looking for form confirmation, you can see the validation plugin: http://docs.jquery.com/Plugins/Validation
However, if you just want to get the example code, it could be so simple:
$(function() {
$('ref-to-input').blur(function() {
if($(this).val().match(/[^\d]/)) {
}
});
});
, :
$(function() {
$('ref-to-input').keyup(function() {
$(this).val($(this).val().replace(/[^\d]/, ''));
});
});
: