Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > Window > Popup Form with Server/Client Validation in Window - Example

Not answered Popup Form with Server/Client Validation in Window - Example

Feed from this thread
  • Danny avatar

    Posted on Dec 13, 2011 (permalink)

    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



    Reply

  • Petur Subev Petur Subev admin's avatar

    Posted on Dec 16, 2011 (permalink)

    Hi Danny,

     I created and attached a project which shows a sample implementation. I hope this helps.

    Kind regards,
    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
    Attached files

    Reply

  • Alex avatar

    Posted on Jan 26, 2012 (permalink)

    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:

    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.
    
    				

    Reply

  • Grzegorz avatar

    Posted on Jan 27, 2012 (permalink)

    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.

    Reply

  • Alex avatar

    Posted on Jan 28, 2012 (permalink)

    Client validation works fine for me with Ajax.  Did you follow the instructions from my previous post?  Are you using Ajax.BeginForm?

    Reply

  • Sachin.Kulkarni avatar

    Posted on Feb 2, 2012 (permalink)

    Alex, can you post the sample solution please? It would help immensely.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > Window > Popup Form with Server/Client Validation in Window - Example
Related resources for "Popup Form with Server/Client Validation in Window - Example"

ASP.NET MVC Window Features  |  Documentation  |  Demos  |  Telerik TV ]