Solved

onTextchanged not firing after a TAB only after ENTER event.

Posted on 2013-12-12
3
1,310 Views
Last Modified: 2013-12-13
I am using asp.net VB:

I have a text box:
 <asp:TextBox   id="cc_tickets" maxlength="4" text="0"  OnTextChanged="cc_tickets_TextChanged"   runat="server"  ></asp:TextBox>

I want to fire a code behind event to do calulations when the user leaves the text box after entering a number:
ENTER works but TAB does not. I need a solution:

code behind:
Protected Sub cc_tickets_TextChanged(sender As Object, e As EventArgs) Handles cc_tickets.TextChanged

     cc_total.Text = CStr(CInt(cc_tickets.Text * 10) + 1) & ".00"

end sub

thanks, john
0
Comment
Question by:john
3 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
Comment Utility
In your form tag set autocomplete=off

<form id="Form1" method="post" runat="server" autocomplete="off">


http://support.microsoft.com/kb/873198]
0
 
LVL 22

Accepted Solution

by:
Mrunal earned 500 total points
Comment Utility
0
 

Author Closing Comment

by:john
Comment Utility
thanks: this is the only solution that worked consistently.
But I changed the 13 to a 9, 13 always fired 9 had not.

TextBox1.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('ctl00_ContentPlaceHolder1_Button1').click();return false;}} else {return true}; ");
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now