I have a form users fill out on web.
I want to validate the existence of telephone number after the user enters the number. Currently, I have an iframe with embedded view that’s hidden if there is not an existing document with the same phone number. This works really well for what I need.
PROBLEM: The issue is with the focus after the doc refreshes. Since the phone number field is just text, there’s no option to “refresh on keyword change”. So I’m using the following code in my onChange:
var Phone = document.forms[0].CustomerPhoneNumber.value;
document.forms[0].CustomerPhoneNumber.value = validatePhone(Phone);
_doClick(‘$Refresh’,this,null);
This will refresh the document for me and show the iframe if necessary. The validatePhone routine is inconsequential, but I included it here so you can see all the code in onChange.
QUESTION: Can I set focus to the next field that should be in the tab order? When I refresh it will just leave focus nowhere (or in the iframe?). I’ve tried adding the following to the end of the onChange with no luck:
document.forms[0].CustomerAddress.focus;