This is a migrated thread and some comments may be shown as answers.

RadButton doesn't fire CustomValidator

4 Answers 149 Views
Button
This is a migrated thread and some comments may be shown as answers.
René Hézser
Top achievements
Rank 1
René Hézser asked on 22 Aug 2011, 12:00 PM
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é

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Aug 2011, 02:41 PM
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.
0
René Hézser
Top achievements
Rank 1
answered on 22 Aug 2011, 02:43 PM
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é
0
Accepted
Slav
Telerik team
answered on 23 Aug 2011, 03:23 PM
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 >>

0
René Hézser
Top achievements
Rank 1
answered on 24 Aug 2011, 07:25 AM
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é
Tags
Button
Asked by
René Hézser
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
René Hézser
Top achievements
Rank 1
Slav
Telerik team
Share this question
or