Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Call Change() function
Message
 
 
À
01/01/2015 18:56:31
Information générale
Forum:
Javascript
Catégorie:
JQuery
Divers
Thread ID:
01612951
Message ID:
01612955
Vues:
38
You are right that I was missing the # sign in front. Thank you!

But now the code works but not exactly as I wanted. The Alert() is called only when I click somewhere outside the textbox. I thought that the Alert() should click just as I start typing.

>In the jQuery code, replace txtMyTextbox with #ClientID
>
>>Actually in my code it is different syntax that uses the "ClientID" syntax. But UT would not let me type it. Here is how I name the control in my script, but where you see a dollar sign it is actually a percent sign.
>>
>>
>>"<$=txtMyTextbox.ClientID $>"
>>
>>
>>
>>>My guess is that txtMyTextbox should be #txtMyTextbox.
>>>
>>>>I am trying to incorporate a jQuery Change function in an asp.net page that would make certain control invisible when user starts typing (making changes) in a text box. My initial test, just to call an alert() does not seem to work. Here is my code:
>>>>
>>>>
>>>><script type="text/javascript">
>>>>       $(document).ready(function () {
>>>>
>>>>           $("txtMyTextbox").change(function () {
>>>>
>>>>               alert("Change Function Called");
>>>>
>>>>           });
>>>>
>>>>   })
>>>></script>
>>>>
>>>>
>>>>What is wrong with my code? TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform