Clearing validation errors on kendo window close

7 posts, 1 answers
  1. Rajesh
    Rajesh avatar
    53 posts
    Member since:
    Jan 2014

    Posted 11 Oct 2014 Link to this post

    I am creating a kendo window for create and edit of my data Item. The kendo window has a form embedded within it as below.

    <div kendo-window="allDevices.addNewDeviceKendoWindow" k-title="'Add'" k-width="520" k-height="520"
                 k-visible="false"
                 k-position='{left:400, top:250}'
                 class="titlewindow" k-on-close="allDevices.resetNewDeviceVariables()">
                <div>
                    <form id="adddeviceform" class="form-horizontal myform" role="form" kendo-validator="myAddDeviceValidator"
                          autocomplete="off" k-options="formValidations" >
                        
                        <ul>
                            <li>
                                <label for="ipAddress" class="control-label">IP Address</label>
                                <input ng-model="allDevices.newDeviceJson.ipAddress" type="text" class="form-control"
                                       name="ipaddress" data-ipaddresscheck data-ipaddresscheck-msg="Enter Valid host IP Address"
                                       required placeholder="Enter IP Address"/>
                            </li>
                          ...

    I notice that if I close the window with a validation error and then try to open the window again, the validation errors still show up.
    How can I also clear the validation errors whenever I open a new window ?
  2. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2895 posts

    Posted 15 Oct 2014 Link to this post

    Hello Rajesh,

    You may hook up to the close event of the window and call the hideMessages method of the Validator widget.
    In this way the validation messages will be cleared when the user re-opens the window again.

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Rajesh
    Rajesh avatar
    53 posts
    Member since:
    Jan 2014

    Posted 15 Oct 2014 in reply to Alexander Valchev Link to this post

    Thank you. That works very well.
  4. Scott
    Scott avatar
    4 posts
    Member since:
    Nov 2017

    Posted 22 Mar 2018 in reply to Alexander Valchev Link to this post

    There is a 404 on the Hide Messages link
  5. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1231 posts

    Posted 26 Mar 2018 Link to this post

    Hi Scott,

    I have just tested the method link and it properly leads to https://docs.telerik.com/kendo-ui/api/javascript/ui/validator/methods/hidemessages. Do you still face any issues with that page?

    Regards,
    Veselin Tsvetanov
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  6. Scott
    Scott avatar
    4 posts
    Member since:
    Nov 2017

    Posted 26 Mar 2018 in reply to Veselin Tsvetanov Link to this post

    it works, thank you!
  7. Fat
    Fat avatar
    3 posts
    Member since:
    Jul 2020

    Posted 09 Jul 2020 Link to this post

    Thanks for your share!
Back to Top