I am trying to restrict users entering Regular Expression value like <%^>/ in RadComboBox while typing but it throws error message "Object doesn't support this property or method"
I want to validate it while typing in RadComboBox.
function OnClientKeyPressing(sender, args) {
if(checkRegEx()) // checking the RegEx value, if pass then proceed else remove the last character entered
{
// Proceed.......
}
else
{
args.set_cancel(true); // ERROR : Object doesn't support this property or method
}
}
<telerik:RadComboBox ID="rcbMonthEndDate" Runat="server" TabIndex="5"
DropDownWidth="100px" MarkFirstMatch="true" AllowCustomText="true" EnableLoadOnDemand="false"
HighlightTemplatedItems="true" OnClientKeyPressing="OnClientKeyPressing"
NoWrap="true" EmptyMessage="Select Date" AutoPostBack="False"
Enabled="true" Width="100px"
DataTextField="MonthEndDate" DataTextFormatString="{0:yyyy-MM-dd}"
DataValueField="MonthEndDate">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "MonthEndDate", "{0:yyyy-MM-dd}")%>
</ItemTemplate>
<ExpandAnimation Type="OutBounce" />
<CollapseAnimation Type="InBack" />
</telerik:RadComboBox>
I want to validate it while typing in RadComboBox.
function OnClientKeyPressing(sender, args) {
if(checkRegEx()) // checking the RegEx value, if pass then proceed else remove the last character entered
{
// Proceed.......
}
else
{
args.set_cancel(true); // ERROR : Object doesn't support this property or method
}
}
<telerik:RadComboBox ID="rcbMonthEndDate" Runat="server" TabIndex="5"
DropDownWidth="100px" MarkFirstMatch="true" AllowCustomText="true" EnableLoadOnDemand="false"
HighlightTemplatedItems="true" OnClientKeyPressing="OnClientKeyPressing"
NoWrap="true" EmptyMessage="Select Date" AutoPostBack="False"
Enabled="true" Width="100px"
DataTextField="MonthEndDate" DataTextFormatString="{0:yyyy-MM-dd}"
DataValueField="MonthEndDate">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "MonthEndDate", "{0:yyyy-MM-dd}")%>
</ItemTemplate>
<ExpandAnimation Type="OutBounce" />
<CollapseAnimation Type="InBack" />
</telerik:RadComboBox>