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

x
?
Solved

OnTextChanged not Firing!

Posted on 2012-03-27
10
Medium Priority
?
933 Views
Last Modified: 2012-03-30
Hello,

I've got an aspx page with TextBox and DropDownList controls on it.  The TextBox controls are populated by a javascript calendar control (Obout brand calendar control).

When I select a date in the calendar, the date appears in the TextBox, but the OnTextChanged  event for the Textbox never fires.  If I manually change the date in the TextBox, however, the OnTextChanged event DOES fire.

I've got AutoPostBack="True" set on both TextBoxes and both DropDownLists.  Also, I have set autocomplete="off" in the master page's <form>.  I have also placed an OnBlur call in the TextBox, but this event only fires when I manually change the date as well.

Any ideas?
0
Comment
Question by:adskarcox
[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
  • 5
  • 3
  • 2
10 Comments
 
LVL 8

Expert Comment

by:gpizzuto
ID: 37773720
OnChanged occurs only if you perform a submit.
You must use javascript/vbscript to enable your OnTextChanged event.
0
 

Author Comment

by:adskarcox
ID: 37773732
gpizzuto- thank you for your reply.  Any idea how one would accomplish that?
0
 
LVL 8

Expert Comment

by:gpizzuto
ID: 37773782
Don't know Obout control, but try to enable the AutoPostBack="True" also to that
0
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 

Author Comment

by:adskarcox
ID: 37773864
I am using a standard ASP.NET TextBox (not Obout - I'm only using Obout DropDownLists).  Also, AutoPostBack="True" is already set.
0
 

Author Comment

by:adskarcox
ID: 37773866
Environment: C#.NET 4.0
0
 
LVL 21

Expert Comment

by:masterpass
ID: 37774040
Can you try to write a javascript function for 'onchange' with similiar code as 'onblur' and see if it works ?

It would look something like this

<asp:textbox id="someid" runat="server" autopostback="true" ontextchanged="" onchange="javascript:__doPostBack('<%= someid.ClientID  %>', '');" />

Open in new window

0
 

Author Comment

by:adskarcox
ID: 37774060
masterpass - thank you for your reply.  Unfortunately, OnChange results in the same problem.  I created a javascript function (containing window.alert("in js!")) and placed it in OnChange and only get the javascript popup when I manually change the text in the textbox.
0
 
LVL 21

Expert Comment

by:masterpass
ID: 37774186
my bad! I have one more work around!

Try using the jquery .change() to handle the situation. An example is here : http://blog.darkthread.net/blogs/darkthreadtw/archive/2010/03/09/jquery1-4-fix-autocomplete-onchange-issue.aspx
0
 

Author Comment

by:adskarcox
ID: 37776649
masterpass - thanks for the link, but this using .change() didn't resolve the issue either (it didn't fire either).
0
 
LVL 21

Accepted Solution

by:
masterpass earned 1000 total points
ID: 37779074
If you can get into the client API of the obout calender control, then you could trigger the change manually. Obout API should expose a method which the programmer can use after the user selects a date from calender. Try to trigger the onchange event manually there.

here is an example of a sample scenario:

http://stackoverflow.com/questions/7097848/textbox-ontextchanged-not-firing
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

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