Thread is closed for posting
2 posts, 0 answers
  1. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 11 Feb 2011 Link to this post


    I have a custom validator for my upload control that checks to see if a there is a file set and b if the file type is correct.  This works fine in the main.

    The problem that I am having is that if you click on the upload button for the form before a file is selected the validation fires and shows that the file is missing, BUT when you then select a file the validator doesn't fire again to clear the error message.  The form can be submitted thus triggering the validation though.

    Please could functionality be added to the control so that validation can be triggered after the select button has been pressed?  At the moment many telerik editor controls seem to be like this while others revalidate on leaving the field.  Eg Combo box.


  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 15 Feb 2011 Link to this post

    Hello Jon,

    The CustomValidator control never fires automatically unless you set the ControlToValidate property and set it to validate for empty text. It won't fire its ClientValidationFunction until a button is pressed to raise that event. If you want the RadUpload control to call the CustomValidator's Validate event, you handle the RadUpload's OnClientFileSelected client-side event and tell the CustomValidator to validate. Like so:

    function OnClientFileSelected(sender, args){
        ValidatorValidate($get("<%=CustomValidator1.ClientID %>"));

    I hope that helps.
Back to Top