abstract:
return true;
else if (dec && (keychar == ".")) {
myfield.form.elements.focus();
return false;
}
else
return false;
}
//-->
I appreciate it if you can help with this query.
Many thanks,
TD
Hi there,
I was wondering how this can be amended to also allow only a full stop from being input?
Code:- <!--
- function numbersonly(myfield, e, dec) {
- var key;
- var keychar;
- if (window.event)
- key = window.event.keyCode;
- else if (e)
- key = e.which;
- else
- return true;
- keychar = String.fromCharCode(key);
- if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
- return true;
- else if ((("0123456789").indexOf(keychar) > -1))
- return true;
- else if (dec && (keychar == ".")) {
- myfield.form.elements[dec].focus();
- return false;
- }
- else
- return false;
- }
- //-->
Copy Code I appreciate it if you can help with this query.
Many thanks,
TD |