I want to use my own Function to validate the Value of a textbox. It's because the format is like 'MMM YYYY' (e.g.: Dec 2014).
I am using the AjaxControlToolkit. I saw that the maskededitvalidator provides me with the property ClientValidatonFunction, such as the CustomValidator does.
The problem is that it seems that this function never gets called.
Here my little JavaScript-function:
<script type="text/javascript">
function MyFunction(sender, args) {
alert("foo");
}
</script>
Here my ASP
<asp:textbox id="StartTextBox" cssclass="textbox"
style="width: 60px;" validationgroup="Dialog"
causesvalidation="false" runat="server">
</asp:textbox>
<ajaxtoolkit:calendarextender id="StartCalendarExtender"
targetcontrolid="StartTextBox" format="MMM yyyy"
OnClientHidden="onCalendarHidden_StartTextBox"
OnClientShown="onCalendarShown_StartTextBox"
BehaviorID="calendar_StartTextBox" runat="server">
</ajaxtoolkit:calendarextender>
<ajaxtoolkit:maskededitextender id="StartMaskedEditExtender"
targetcontrolid="StartTextBox" enabled="false"
mask="??? 9999" masktype="Date" oninvalidcssclass="textbox_invalid"
runat="server">
</ajaxtoolkit:maskededitextender>
<ajaxtoolkit:maskededitvalidator id="StartMaskedEditValidator"
controlextender="StartMaskedEditExtender" display="Dynamic"
controltovalidate="StartTextBox"
clientvalidationfunction="MyClientFunction" enableclientscript="true"
enabled="true" isvalidempty="false" runat="server">
</ajaxtoolkit:maskededitvalidator>
My Alert never apears.
The question is what am I doing not right or what have I to change to make the clientvalidationfunction gets called?
AoE