The change event is fired when as element change its value. This is commonly use to checkboxes, radio buttons, drop down and the likes. Some element fired immediately but others does when you loses focus.
Here is the sample HTML Code using drop down, I have it on the ASP.NET Solution. It shows the whole code inside the <body> tag to get full idea of how it is coded in one page.
In [Box1], Script Reference is set. Before you can use a jQuery function, you have to have a script reference to a jQuery library to use. On my example above, I have my jQuery library saved on the project itself under Scripts folder.
In [Box2], the javascript code is placed. In my example above, I show the selected value to the a TextBox. In ASP.NET, the ID of the component changes as you run the application, to make sure that we are calling the same ID of the object we use the following code <%=NameOfTheField.ClientID %>.
[Box3] has the HTML tag.
In [Box2], the javascript code is placed. In my example above, I show the selected value to the a TextBox. In ASP.NET, the ID of the component changes as you run the application, to make sure that we are calling the same ID of the object we use the following code <%=NameOfTheField.ClientID %>.
[Box3] has the HTML tag.
L.






0 comments:
Post a Comment