
AidenA
asked on
jquery: textbox contracts onblur and button beside it moves with it... and can't be clicked?
Hi, as the title suggests, I wondering what's the best way to deal with this situation. I have a textbox and button beside it (on the right side) in a flow layout. I use jquery to expand the textbox to the right which then pushes the button to the right also.
The problem is I want to contract the textbox back to it's original size when it loses focus (onblur even). But, if you have the situation where it loses focus because the user wants to click that button then it doesn't seem to work as the button moves to the left with the contracting textbox, but the click even doesn't appear to have been fired.
How exactly would I get around this situation so that the click even of the button fires before it moves to the left due to the contracting textbox because it's onblur even was fired?
The problem is I want to contract the textbox back to it's original size when it loses focus (onblur even). But, if you have the situation where it loses focus because the user wants to click that button then it doesn't seem to work as the button moves to the left with the contracting textbox, but the click even doesn't appear to have been fired.
How exactly would I get around this situation so that the click even of the button fires before it moves to the left due to the contracting textbox because it's onblur even was fired?
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.

if(btnName.Focused)
{
btnName_Click(null, null);
}
ASKER CERTIFIED SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.

ASKER
solution found
ASKER
first i need to check if the button hasfocus which i can't quite see how to do? then i need to call the buttons click event... could you provide code example?