How do I execute an JavaScript function right when an ASP.NET text box control is populated and focus is still set? The onChange
event will not work because I need to programmatically move focus to the next form element after the JavaScript function has executed.
Is is very similar to this question. The marked answer is correct for the context on the question, but after some more testing it did not exactly solve my current issue.
Pseudo code:
<script language="javascript" type="text/javascript">
function MyFunction() {
//execute this function when MyTxtBox is populated and focus is still set
//once core function is completed, move focus to MyTxtBox1
}
</script>
<style type="text/css">
.USBBox
{
position: absolute;
left: -999em;
overflow: hidden;
}
</style>
<asp:TextBox id="MyTxtBox" runat="server" CssClass="USBBox" />
<asp:TextBox id="MyTxtBox1" runat="server" />