Solved

Asp text control onchanged event

Posted on 2004-04-19
5
418 Views
Last Modified: 2012-05-11
hi, experts.

would it be possible that i have asp text control and hook on onchanged event to client script at html page ? i've tried that...but couldn't get it work. cause i dont it to postback to server and can do online calculation on client browser. any solution other than using pure html text control ?

thank you.

0
Comment
Question by:Explorer060599
5 Comments
 
LVL 6

Expert Comment

by:zulu_11
Comment Utility
you can use javascript..for the same..

Zulu_11
0
 
LVL 28

Expert Comment

by:mmarinov
Comment Utility
i'm agree with zulu - if you choose such a scenario it is much easier to do it with javacript
the other solution is to make everything on the server, but then if your form contains a lot of controls it will be slow if you add autopostback to every control. so if you decide to make calculation on the server make them after you submit all the data

B..M
0
 
LVL 5

Expert Comment

by:chaniewskim
Comment Utility
you can use Attributes collection of text control to add onchanged handler:

myTextBox.Attributes.Add( "onhange", "javascript:alert('It works!');" );
0
 
LVL 5

Accepted Solution

by:
chaniewskim earned 125 total points
Comment Utility
ooops, a typo, should be:

myTextBox.Attributes.Add( "onchange", "javascript:alert('It works!');" );

(and not 'onchanged' because it's not correct name of that event)
0
 

Author Comment

by:Explorer060599
Comment Utility
thank you very much chaniewskim, l've been seraching this solution for some times.
supprising that it's easiear what i though.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

743 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

16 Experts available now in Live!

Get 1:1 Help Now