What\'s the best way of validating an HTML text input as it\'s typed? All ways I know of doing it has some drawbacks:
Using $.keypress you only
Here is the code
function validatephone(xxxxx)
{
var maintainplus = '';
var numval = xxxxx.value
if ( numval.charAt(0)=='+' )
{
var maintainplus = '';
}
curphonevar = numval.replace(/[\\A-Za-z!"£$%^&\-\)\(*+_={};:'@#~,.Š\/<>\" "\?|`¬\]\[]/g,'');
xxxxx.value = maintainplus + curphonevar;
var maintainplus = '';
xxxxx.focus;
}