Solved

onTextchanged not firing after a TAB only after ENTER event.

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
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 …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

947 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

19 Experts available now in Live!

Get 1:1 Help Now