I have a textbox that sets the onchange property but when i start typing in the textbox the onchange doesnt fire initially. it never fires whats going on?
Here is the code:
VB.NET
Dim textBoxUrlYoutube As New TextBox
divUrlTextBoxContainer.Controls.Add(textBoxUrlYoutube)
textBoxUrlYoutube.CssClass = "textboxyoutubeurlmediaselector"
textBoxUrlYoutube.Attributes.Add("onchange",
"YoutubeUrlSaveTextBoxOnChange(this)")
JAVASCRIPT
function YoutubeUrlSaveTextBoxOnChange(el) {
var text = $(el).val();
if (text == '') {
$("a.linkplayyoutubeurl2").attr("class", "linkplayyoutubeurl1");
$("div.divlinktext2").attr("class", "divlinktext1");
}
else {
$("a.linkplayyoutubeurl1").attr("class", "linkplayyoutubeurl2");
$("div.divlinktext1").attr("class", "divlinktext2");
}
}