thirdage
thirdage

Reputation: 225

How to read from textfield using ajax?

So here's the thing am trying to do: I have a textfield and am writing things inside of it.

Using ajax am able to change the content of a div, by setting its content to whatever there is in the textfield.

However the problem is that am using the onChange event of the textfield! Is there a way to make the div content change automatically (in real-time) rather than using the onChange event?

Upvotes: 2

Views: 82

Answers (2)

anups
anups

Reputation: 583

Don't do a lot of dependency tracking yourself if you have more than one instance of such stuff.

Have a look http://knockoutjs.com/. It will do it for you, although I would use it if i had more than one places where i could use that.

You could also look at Angularjs and Emberjs - for other features. (HandlerbarsJS might also have some dependency tracking - but i m not sure of that)

Upvotes: -1

T. Stone
T. Stone

Reputation: 19495

Use the onkeydown event instead.

Upvotes: 2

Related Questions