I have a text field which I attach a required field validator. I have a button that initiates a clear() method but this is causing validation to fire. Any idea of what might be wrong here? I can change this to an asp textbox and set the value to the asp textbox without validation firing as usual.
<
telerik:RadTextBox
Save
=
"Text"
ID
=
"txtCode"
onblur
=
"UcaseTextbox(this, event)"
runat
=
"server"
MaxLength
=
"4"
Width
=
"50px"
TabIndex
=
"1"
CssClass
=
"textUpper"
ToolTip
=
"Vendor Code"
CausesValidation
=
"False"
>
</
telerik:RadTextBox
>
<
asp:RequiredFieldValidator
ID
=
"reqCode"
runat
=
"server"
ControlToValidate
=
"txtCode"
Display
=
"Dynamic"
ErrorMessage="<br>Vendor Code required"
SetFocusOnError="True" ForeColor="Red"></
asp:RequiredFieldValidator
>
<
asp:Button
ID
=
"btnClear"
runat
=
"server"
Text
=
"Clear"
CausesValidation
=
"false"
UseSubmitBehavior
=
"false"
OnClientClick
=
"ResetScreen(); return false;"
ToolTip
=
"Clear"
TabIndex
=
"3"
/>
function ResetScreen() {
$find("txtCode").clear();
}