Solved

onTextchanged not firing after a TAB only after ENTER event.

Posted on 2013-12-12
3
1,451 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 39715797
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
ID: 39716318
0
 

Author Closing Comment

by:john
ID: 39716631
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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