// copyright 1999 Idocs, Inc. http://www.idocs.com
// Distribute this script freely but keep this notice in place
function textonly(myfield, e, dec)
{
// To use this, place this in the textbox tag:  onKeyPress="return numbersonly(this, event)"
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   //Original coding.  Modified to allow decimal.
   //myfield.form.elements[dec].focus();
   //return false;
   return true;
   }
else
   return false;
}
// copyright 1999 Idocs, Inc. http://www.idocs.com
// Distribute this script freely but keep this notice in place
function textnumonly(myfield, e, dec)
{
// To use this, place this in the textbox tag:  onKeyPress="return numbersonly(this, event)"
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("abcdefghijklmnopqrstuvwxyz0123456789_@#&*~$").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   //Original coding.  Modified to allow decimal.
   //myfield.form.elements[dec].focus();
   //return false;
   return true;
   }
else
   return false;
}
