Solved

onTextchanged not firing after a TAB only after ENTER event.

Posted on 2013-12-12
3
1,518 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

691 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