MayMusic,
Thank you for your suggestion all worked fine. For a single record update form with a textbox field called Phone_Home, I used the code below placed in the footer:
<SCRIPT LANGUAGE="JavaScript">
function tel() { // Read the content of the textbox var message = document.getElementById("EditRecordPhone_Home").value;
//Skip function if textbox is empty, else you will see () -
if (message != "") {
// Strip off all the spaces document.getElementById("EditRecordPhone_Home").value = (message.replace(/[^\d]/g, '')); var message1 = document.getElementById("EditRecordPhone_Home").value; document.getElementById("EditRecordPhone_Home").value = ("(" + message1.substring(0,3) + ") " + message1.substring(3,6) + "-" + message1.substring(6,10)); } }
// Call function when value in the textbox changes document.getElementById('EditRecordPhone_Home').onchange=tel;
</SCRIPT>
I have three other fields called Phone_Work, Phone_Cell and Phone_Fax. Would you happen to know a single code that can be called for all four fileds. The other option will be to copy the above code 4 times.
Thank You again.