How to deals with ordered action (in example, Blur and Focus)
Hey,
I got this problem when I'm using jQuery-UI. Suppose I have a form with two inputs.
<form action="" method="post">
<input type="text" name="input1" value="" />
<input type="text" name="input2" value="" />
</form>
When I click the "input2", then the method "focus" was fired. Now, when the
cursor is still on "input2", I want to click "input1". In details, the action should
be like this (in order): blur at "input2" and focus at "input1".
I create a jQuery function like this:
$("input").focus(function()
{
$("#result").html("Show this");
});
$("input").blur(function()
{
$("#result").html("");
});
with those code, I want to delete first (when blur fired) and fill the div (id="result")
with the new value. I tried this but jQuery seems to fill the div first, and then erase
the contents of the div.
Did anyone have any experience on this? How to deal with this situation?
Thank you very much.<br clear="all">
--
Kristiono Setyadi
Web Programmer and Developer
Citraweb Nusa Infomedia
<a href="http://citra.web.id/">http://citra.web.id/</a>
<a href="http://kristiono-setyadi.net/">http://kristiono-setyadi.net/</a>
--