/********************************************************************************** * Author: David Millar (www.rTraction.com) * * Date: January. 1, 2007 * * Purpose: Clear Text when you click on input text boxes * * * ********************************************************************************** * Revision 1.0: adds/removes text from input box * **********************************************************************************/ // Clears text from a text box if it matches a passed in default function clearText(id,defaultText) { var myObj = document.getElementById(id); if( myObj.value == defaultText ) { myObj.style.textAlign = "left"; myObj.value = ""; } } // Resets text when focus is lost if text is blank function resetText(id,defaultText) { var myObj = document.getElementById(id); if( myObj.value == "" ) { myObj.style.textAlign = "left"; myObj.value = defaultText; } }