I have try to use CustomValidator with telerik:RadTextBox but it is not fired?
And in telerik:RadScriptBlock
Nothing happand, but if i change to <asp:TextBox it works??
Why does it not work with telerik:RadTextBox?
<
telerik:RadTextBox
ID
=
"rtbTelefon"
MaxLength
=
"50"
Width
=
"220px"
EmptyMessage
=
"Telefon"
ToolTip
=
"Telefon"
runat
=
"server"
/><
telerik:RadTextBox
ID
=
"rtbEpost"
MaxLength
=
"50"
Width
=
"230px"
EmptyMessage
=
"E-postadress"
ToolTip
=
"E-postadress"
runat
=
"server"
/> <
asp:CustomValidatorid
=
"AtLeastOneContact"
ClientValidationFunction
=
"AtLeastOne_ClientValidate"
Display
=
"None"
ErrorMessage="Telefon <b>eller</
b
> e-post krävs!" SetFocusOnError="True"runat="server" />
And in telerik:RadScriptBlock
function
AtLeastOne_ClientValidate(source, args) {
if
(document.getElementById(
"<%= rtbTelefon.ClientID %>"
).value ==
""
&&
document.getElementById(
"<%= rtbEpost.ClientID %>"
).value ==
""
) {
args.IsValid =
false
;
}
else
{
args.IsValid =
true
;
}
}
Nothing happand, but if i change to <asp:TextBox it works??
Why does it not work with telerik:RadTextBox?