Can I use OnTextChanged in JavaScript for TextBox


    Sponsored Links


  • 1. Moving a DataGrid programmatically
    This might seem like a dumb question, but.... I have several DataGrid objects on an ASP.NET page, and I connot figure out how to move them around on the page programmatically. I want to move them relative to each other, based on how much/what data is displayed in them. Thanks in advance. ~D
  • 2. onclick
    Quisiera saber si es posible llamar un procedimiento, funcion que este definida en la clase que define la pagina desde un evento adido dinamicamente a un objecto (ejemplo textbox). Se que el evento se dispara pues al momento de ejecutar el debuger se detiene en la definicion del evento diciendome error de javascript. Se que una manera seria definir el procedimiento en el html de la pagina aspx. Pero yo quisiera poder usar las que defino en pagina.aspx.vb. Espero poder haberme explicado. Ejemplo de la programacion: Este ejemplo pinta un textbox, se programa en la clase de la pagina para que ada el evento onclick y si el usuario en ejecucion le da click al textbox se deberia ejecutar prueba. pagFormula.aspx Se pinta un textbox: txtTexto pagFormula.aspx.vb imports System.Web.UI.WebControls Imports Microsoft.Web.UI.WebControls Public Class pagFormulas1 Inherits System.Web.UI.Page Protected WithEvents txtTexto As System.Web.UI.WebControls.TextBox Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here txtTexto.Attributes.Add("onclick", "prueba") End Sub public sub Prueba() txtTexto.text="Presiono" Saludos
  • 3. Complie against different versions of .NET framework
    Hope somebody here can give me some help here. I have a development environment with VS.NET 2003 (7.1), and Framework 1.1. My server is also running ASP.NET 1.1. I have downloaded the IEWebControls, which has the TreeView control to use in one of my pages. The TreeView control will not work with the environment I have. The documentation says I need VS.NET 2002 and Framework 1.0, which I don't have or can't get it. I also found a utility called NAnt, that will help compile a project of .NET against different versions of framework. Now the problem is I am not able to find any direction on how to compile ASP.NET applications with different versions of .NET framework using NAnt. Can somebody point me to some samples? If not, is it possible to use Visual Studio.NET to compile against different versions of the .NET framework? If so, can you point me to some articles that will also be helpful? Can somebody help me?? Vijay
  • 4. Min/Max date values for calendar control
    Hi all, Anyone have a idea what the min and max dates the calendar control can handle, we've seen nothing in the documentation. We have some instances where were setting effective dates to System.DateTime.MinValue and System.DateTime.MaxValue, were getting errors with this range and can shorten it up to match the limitations of the calendar control. Thanks, Steve
  • 5. DDL DataValueField does not set properly
    Hi, I'm binding a DataSet to a DropDownList control which works fine. What doesn't work is the DataValueField. Here's my code (C#) on the Page_Load event: SomeClass A = new SomeClass(); DataSet myDS = new DataSet(); myDS = A.GetEmployeesDS(); // the A object has a method which returns a DataSet object myDDL.DataSource = myDS; myDDL.DataMember="EmployeesTable"; // the table name from which data originates (do I need this?) myDDL.DataTextField = "EmployeeName"; // column which contains text to display myDDL.DataValueField = "EmployeeID"; // column which contains a unique ID myDDL.DataBind(); The result is that the DDL's DataTextField is populated with the data from the DataSet, but the DataValueField holds the value "EmployeeID" for all items in the DDL. I'm not sure why it treats EmployeeID as a literal and EmployeeName as a column/data. Even if I remove the line of code where I set the DataMember, it displays the EmployeeName. Am I missing anything? Thank you for you help. Peter

Can I use OnTextChanged in JavaScript for TextBox

Postby Leo » Thu, 20 Nov 2003 03:25:39 GMT

I have my textbox control, I want to fire an event for 
TextChanged, how can I do this?

Can I use OnTextChanged in JavaScript for TextBox

Postby Jon Paugh » Thu, 20 Nov 2003 05:32:52 GMT

try this:
set the "OnChange" attribute for your server side control 
to your js function in the onload event of your page's 


Similar Threads:

1.JavaScript for OnTextChanged event.


I have created a web-based file manager. Now I'd like to watch a folder for 
changes, and when a change occurs I'd like to refresh my page.
Okay. So I have created a FileSystemWatcher set on the folder I need to 
watch. It works fine. The problem occurs when I need to trigger an automatic 
So I added two handlers - OnChanged and OnRename, in the same class as my 

In the handlers I tried to say Response.redirect(mypage) to force the 
refresh, but the error I got was: "Cannot redirect after HTTP headers have 
been sent."

So I tried to change the text of some textbox instead
<asp:textbox id="txtFileSystemWatcher" 
OnTextChanged="javascript:RefreshPage();" Visible=true  Width=500 

with this handler:
Private Sub OnChanged(ByVal source As Object, ByVal e As 
    txtFileSystemWatcher.Text = "FileSystemWatcher: " & "File: " & 
e.FullPath & " " & e.ChangeType
End Sub

and add an OnTextChanged client-side event-handler which looks like this:

function RefreshPage() {
    __doPostBack('txtFileSystemWatcher', '');

which would force the refresh. However, now I have the following error:
BC30456: 'javascript' is not a member of 'ASP.BrowseFiles_aspx'.

So I changed the HTML to
<asp:textbox id="txtFileSystemWatcher" OnTextChanged="RefreshPage()" 
Visible=true  Width=500 Runat=server></asp:textbox>
and now, sure enough, I get
BC30456: 'RefreshPage' is not a member of 'ASP.BrowseFiles_aspx'.

I also tried in OnLoad of the page to register the event with
txtFileSystemWatcher.Attributes.Add("OnTextChanged", "RefreshPage()")

but it still does not work.

What am I missing here, please ?

Thank you, Alex 

2.Accessing Textbox inside a Template column using javascript

I am having a datagrid with a template column. Inside the template column I
have a textbox and an image button. On click of the image button, I want to
call a javascript function, where the textbox value has to be taken.

Since the textbox is inside the datagrid, how can I access the Textbox in a
javascript function?

what is happening now is that if I give document.frmname.textboxname then it
won't recognise because for textboxes in each row of the datagrid is
internally given a different name.

can you please assist me regarding this?

Thanks & Regards,

3.How can i change de cssclass of a textbox in runtime using javascript

I need to change de css of an textbox control.
So, on mouseover event, the class will be one, and on mouseout event it will 
be another.
Something like:


How can i do that?
Somebody have any idea?


Fernando Lopes 

4.get Textbox Value in datagrid using JavaScript

Hi, All:

I have a datagrid that embedded 3 textbox using TemplateColumn. When
the user key in value in the first textbox, I need to check to see if
this value is between the the values in other 2 textboxes. I know I can
postback to server side and using datagrid findcontrol to get values of
these 3 textboxes and compare them. But it kind of combersome cause
every change in textbox 1 I need send back to server.

My question is how can I get other 2 textboxes values in the same row
of textbox1 using Javascript? I am using onChange function for
textbox1. Is it doable? any example?

Thanks a lot
-Rockdale can I used javascript for chaging values in TextBox

6. link textboxes in gridview EditItem template using javascript

7. Dynamically generate textboxes using javascript

8. How to get OuterHtml in a TextBox using Javascript

Return to ASP.NET


Who is online

Users browsing this forum: No registered users and 32 guest