|
-
Sep 21st, 2001, 09:02 AM
#1
Thread Starter
Hyperactive Member
Onfocus code problem
Hi everyone!
I have a textbox called 'atm' (form is called 'AddCustForm') with two event handlers: onFocus and onBlur. Here is the code for both events.
Code:
onBlur="LookForBlank(this);"
function LookForBlank(sAtmNumb){
if (sAtmNumb.value=='' || sAtmNumb.value=='undefined'){
alert('The ATM # is missing. Please enter a ATM Number.');
AddCustForm.atm.focus();}
else{
document.location.href="addatmcust.asp?ATMNUMB=" + sAtmNumb.value;
}
}
onFocus="if (AddCustForm.atm.value != '' || AddCustForm.atm.value != 'undefined'){AddCustForm.customer.focus();}
The onBlur event works fine, but it is somehow conflicting with the onFocus event. This is how I want the onFocus event to work: If the atm field is NOT empty or NOT equal to 'undefined' then move the focus to the next field. I hope I haven't confused anyone.
Any input will be greatly appreciated. Thanks in advance.
-vbuser1976 
VB6 Enterprise SP6
SQL 7.0 SP2
VBScript, HTML, Javascript, C++, a little UNIX
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|