Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

onTextchanged not firing after a TAB only after ENTER event.

Posted on 2013-12-12
3
Medium Priority
?
1,660 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

610 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