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

[Solved] clientside validation in mvc1

3 Answers 90 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel Collier
Top achievements
Rank 1
Daniel Collier asked on 22 Mar 2010, 05:42 AM
In your clientside validation demo, you used the mvc2 data annotations feature.  Do you support any clientside validation in mvc1?

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 22 Mar 2010, 11:08 AM
Hello Daniel,

ASP.NET MVC 1.0 does not support client-side validation at all. MVC 1.0 has only server-side validation.
We depend on the framework validation support. Hence there is no way how to support client validation with MVC 1.0

Regards,
Georgi Krustev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Daniel Collier
Top achievements
Rank 1
answered on 22 Mar 2010, 02:35 PM
Thanks for the response, George.  I can understand your approach regarding mvc validation.  I think my confusion now is we cannot seem to use other means of client side validation.  We had been using jquery validation (ie. class = "required") on our required elements.  I see where we can add client events and I guess we could use those to validate, but that would be rather tedious in my mind.

With your controls, we tried adding validation inside a view page using something like this, and while it seems to work for non telerik inputs, this does not work for any Telerik inputs.  Is there something else we could try to get clientside jquery validation to work?


<%Html.Telerik().ScriptRegistrar().Scripts(scripts => scripts.AddGroup("Validation", group => group.Add("~/Scripts/jquery.validate.js"))).OnDocumentReady(() =>
       {%>
      $("#editform").validate({
          rules: {
            beginDate: {
              required: true
            },
            endDate: {
              required: true
            },
            user: {
              required: true
            },
            zipCode: {
              required: true
            }
          }
      });
<% });%>
0
Georgi Krustev
Telerik team
answered on 23 Mar 2010, 01:11 PM
Hi Daniel Collier,

Here is a simple test project which shows how to use jQuery.validate with out NumericTextBox component.

Best wishes,
Georgi Krustev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Daniel Collier
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Daniel Collier
Top achievements
Rank 1
Share this question
or