?
Solved

OnTextChanged not Firing!

Posted on 2012-03-27
10
Medium Priority
?
926 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
Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

770 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