asp.net - Can i pass the ID name in an onChange event for a textbox? -
I have 3 text boxes that check the entered date. I was originally code for a text box. On-Change Event
& lt; Asp: textbox id = "txtDate" runat = "server" width = "110px" onChange = "there is a way to pass ID name on checkEnteredDate ('txtDate' ')" & gt; & Lt; / ASP: text box & gt; Function checkendend (var text box = new string ();) {var inputDate = document.getElementById (textbox); // if statement to check for a valid date var formatDate = new date (inputDate.value); If (formatDate> nowadays) {Warning ("You can not select a date compared to today."); InputDate.value = Today's date. Format ("MM / DD / Yay"); }}
You must do this in your code's page_load Is behind:
txtDate.Attributes ["onchange"] = string.format ("checker date ('{0}');", txtDate.ClientID);
Comments
Post a Comment