By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,034 Members | 822 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,034 IT Pros & Developers. It's quick & easy.

Reg..FocusLost event

P: 8
Hi,
i have text field with min.value = 1 & max.value = 100. whenever i give out of range value and click on anywhere in the form, its throing the error "Out of range". It's perfectly ok. but if i click on cancel button, it throws the same error. for me it should not popup. b'cz the purpose of clicking the cancel is to exit from the form. but it is not allowing me to exit.
the code is

focusLost( FocusEvent event )
{
if ( !event.isTemporary() )
{
//doing validation..if it is not valid, then it popup the errror msg.
attributeChangeEvent( event );
}
}
what i need is before calling attributechangeevent(), i want to check where the focus is now, if it is on cancel button then i think i shudnot call that method.
so how can i check where the focus is?.

Thanks...
Babu Shanmugham
Nov 13 '06 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
Hi,
i have text field with min.value = 1 & max.value = 100. whenever i give out of range value and click on anywhere in the form, its throing the error "Out of range". It's perfectly ok. but if i click on cancel button, it throws the same error. for me it should not popup. b'cz the purpose of clicking the cancel is to exit from the form. but it is not allowing me to exit.
the code is

focusLost( FocusEvent event )
{
if ( !event.isTemporary() )
{
//doing validation..if it is not valid, then it popup the errror msg.
attributeChangeEvent( event );
}
}
what i need is before calling attributechangeevent(), i want to check where the focus is now, if it is on cancel button then i think i shudnot call that method.
so how can i check where the focus is?.

Thanks...
Babu Shanmugham
You do not need to check where the focus is but if the focus is on the cancel button. Also you are better off asking this in the javascript(!= java) forum on this site.
Nov 13 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.