I have a autocomplete dropdown that lists a bunch of contact names that someone can choose from in a form that allows them to post an information set.
Now it may occur sometimes where the name that the person is typing in does not yet exist so I have a popup that asks them if they want to continue searching for a contact, or if they want to add a new contact. This works great when adding a new Information set, but if you go back to edit one and want to change the Contact name I am having some problems.
When they click on the contact textbox, it clears the textbox as well as a hidden control that contains the original ID. I then have an onBlur for the textbox that check, if the textbox has something in it, and the Hidden Control is blank, it asks if you want to continue searching or add a new contact.
The problem here is, when you click to select an existing name, it fires the on Blur, because your focus is now on the autocomplete list, but the Select: from AJAX hasn't fired yet, and the new ID hasn't been assigned to the hidden control yet.
Can anyone think of a way to achieve this functionality? I want the popup alert to appear as soon as they try entering a contact that doesn't exist. I am able to get it all to work if I wait until they hit the Submit button but I don't want it to wait that long.
I hope I have adequately explained my situation and someone can help
You don't show code, so this is a guess, but I think you need 3 states in the popup - continue, add, edit. Then you may need a hidden edit control to trigger or not trigger focus(), etc.
It seems that user editing is a set up for user pranks with contact names. You might want to think through that use case. You may end up wanting the user to hit Submit so the server can do some validation. Just a thought.