This question is locked. New answers and comments are not allowed.
Hi,
I'd like to know if you can point me to the direction where I can find an example for Popup Form with Server/Client Validation in Telerik Window control.
The demos in the Demo section work really well, but there is no example for a Form with Validation in Window.
Thanks in advance,
Danny
I'd like to know if you can point me to the direction where I can find an example for Popup Form with Server/Client Validation in Telerik Window control.
The demos in the Demo section work really well, but there is no example for a Form with Validation in Window.
Thanks in advance,
Danny
5 Answers, 1 is accepted
0
Hi Danny,
Petur Subev
the Telerik team
I created and attached a project which shows a sample implementation. I hope this helps.
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Alex
Top achievements
Rank 1
answered on 26 Jan 2012, 08:09 PM
This example looks incomplete. The action just returns the view with the passed in model. This results in the Index view being rendered with the popup form closed and no validation messages visible. After clicking the "submit feedback" button a 2nd time the popup form shows the validation messages. That's not at all user friendly.
When Server Side validation fails, the user's view should not change. The popup form should remain on the screen. The only change should be the failed validation highlighting and messages.
I was able to get this functionality to work by using an Ajax form. I followed these instructions to create the components. My window code looks like this:
_Create is my partial view with Html.AjaxForm code. You should be able to figure out the rest by following the examples. Make sure you have jquery.unobtrusive-ajax.js referenced or else your ActionResult will render in a new window instead of replacing the Form when validation fails.
When Server Side validation fails, the user's view should not change. The popup form should remain on the screen. The only change should be the failed validation highlighting and messages.
I was able to get this functionality to work by using an Ajax form. I followed these instructions to create the components. My window code looks like this:
Html.Telerik().Window() .Name("Window") .Title("Create New Item") .Content(@<div id="CreateItemFormContainer"> @Html.Partial("_Create",Model) </div>) .Width(550) .Draggable(true) .Modal(true) .Visible(false) .Render();
_Create is my partial view with Html.AjaxForm code. You should be able to figure out the rest by following the examples. Make sure you have jquery.unobtrusive-ajax.js referenced or else your ActionResult will render in a new window instead of replacing the Form when validation fails.
0
Grzegorz
Top achievements
Rank 1
answered on 28 Jan 2012, 03:44 AM
How to enable client side validation if the form on Window which is loaded as dynamic partial view using jquery.ajax?
Client side validation works fine when the Window with form in it is rendered as static view, but when switching to dynamic it stops working.
Client side validation works fine when the Window with form in it is rendered as static view, but when switching to dynamic it stops working.
0
Alex
Top achievements
Rank 1
answered on 28 Jan 2012, 02:51 PM
Client validation works fine for me with Ajax. Did you follow the instructions from my previous post? Are you using Ajax.BeginForm?
0
Conan.Whalen-McKain
Top achievements
Rank 1
answered on 02 Feb 2012, 10:54 PM
Alex, can you post the sample solution please? It would help immensely.