RadButton doesn't fire CustomValidator

5 posts, 1 answers
  1. René Hézser
    René Hézser avatar
    18 posts
    Member since:
    Oct 2009

    Posted 22 Aug 2011 Link to this post

    Hi,
    I've a Checkbox, with a custom validator:
    <asp:CheckBox ID="Datenschutz" runat="server" />
    <asp:CustomValidator ClientValidationFunction="ValidateDatenschutz" runat="server" ID="DatenschutzValidator" CssClass="..." ErrorMessage="<br/>..." />
    The RadButton is here:
    <telerik:RadButton ID="Submit" runat="server" Text="Speichern" OnClick="OnSubmitClick" CausesValidation="true" />

    The JavaScript validation looks like this:
    function ValidateDatenschutz(sender, eventArgs) {
        eventArgs.IsValid = document.all[datenschutzCheckboxId].checked;
    }
    (datenschutzCheckboxId is defined)
    Clicking on the button in IE calls the validation function. Firefox, however, does not.

    Is this a known problem, or did I make a mistake?

    Thank you
    René
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Aug 2011 Link to this post

    Hello Rene,

    I have tried to reproduce he issue at my end but no avail. Please make sure that you have not disable the javascript for the browser.
    Enabling and disabling JavaScript.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. René Hézser
    René Hézser avatar
    18 posts
    Member since:
    Oct 2009

    Posted 22 Aug 2011 Link to this post

    Hi Princy,
    JavaScript is enabled, since validating other controls (via JavaScript) works just fine.
    I've even used the latest build, but it didn't help.

    René
  5. Answer
    Slav
    Admin
    Slav avatar
    1356 posts

    Posted 23 Aug 2011 Link to this post

    Hi René,

    You can check the solution for your problem in the other support ticket that you have already sent. When sending support tickets in the future, please use only one for a particular issue. That way it will be much easier for both of us to keep track of the conversation and to solve the problem much faster by clear communication. That being said, I would suggest that we continue our discussion in your other ticket. When the provided solution is confirmed, you may post it here as well, so that the community can benefit from it.

    Best wishes,
    Slav
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  6. René Hézser
    René Hézser avatar
    18 posts
    Member since:
    Oct 2009

    Posted 24 Aug 2011 Link to this post

    Hi Slav,
    thank you. The problem is solved.
    For the record: it was not a problem with telerik. The problem sat in front of the keyboard. My JavaScript function was IE specific. Use "eventArgs.IsValid = $get(datenschutzCheckboxId).checked;" instead, an you are fine.

    René
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017