5 Answers, 1 is accepted
0
Hello Ivan,
Alexander Valchev
the Telerik team
I suggest using jquery.validator.unobtrusive.parse method to achieve your goal. There is a sample project for common validation problems in our code library.
I hope this information helps. Please let me know if I can assist you any further.
Alexander Valchev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Ivan
Top achievements
Rank 1
answered on 09 Feb 2012, 11:20 AM
I tried with jquery.validator.unobtrusive.parse butt with no results.
Try to put <form> tag around tabstrip, and you will see, or just check attached solution.
Try to put <form> tag around tabstrip, and you will see, or just check attached solution.
0
Hi Ivan,
Alexander Valchev
the Telerik team
<form> tag should not be wrapping the tabstrip, but the form's elements themselves.
@model User @*@Html.EditorForModel()*@ @using (Html.BeginForm()) { @Html.TextBoxFor(model => model.UserName, new { style = "width:200px;" }) @Html.ValidationMessageFor(model => model.UserName) <br /> @Html.TextBoxFor(model => model.Email, new { style = "width:200px;" }) @Html.ValidationMessageFor(model => model.Email) <input type="submit" value="Save" /> }I edited your project. Please check the attachment.
Greetings,Alexander Valchev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Ivan
Top achievements
Rank 1
answered on 09 Feb 2012, 02:38 PM
Butt I want exactly tabstrip to be placed inside of <form> tag .
Because I have several tabs and all of them should reside in one <form> tag for later submission to server.
Because I have several tabs and all of them should reside in one <form> tag for later submission to server.
0
Accepted
Hello Ivan,
It is not possible to validate the form items loaded via Ajax in your case, because:
This way all the problems above will be avoided.
Greetings,
Alexander Valchev
the Telerik team
It is not possible to validate the form items loaded via Ajax in your case, because:
- If there is no form in the partial view so validation attributes of input fields will not be rendered.
- If there is a form, it will be possible to validate and submit the data only within the current tab. However that will not work in Chrome, because the inner form will not be added to the DOM tree.
In addition when you use LoadContentFrom method, input fields will not be added before their tab is selected. In other words, fields that are not loaded will not be validated or submitted.
I suggest you to load form fields on the server using the Content method. For example:
I suggest you to load form fields on the server using the Content method. For example:
.Items(items =>{ items.Add().Text("Insert in Ajax Loaded Tab") .Content(Html.Action("InsertUser").ToHtmlString());})This way all the problems above will be avoided.
Greetings,
Alexander Valchev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>