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

Clearing validation errors on kendo window close

6 Answers 878 Views
Integration with other JS libraries
This is a migrated thread and some comments may be shown as answers.
Rajesh
Top achievements
Rank 1
Rajesh asked on 11 Oct 2014, 06:37 PM
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 ?

6 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 15 Oct 2014, 07:28 AM
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!
 
0
Rajesh
Top achievements
Rank 1
answered on 15 Oct 2014, 10:11 AM
Thank you. That works very well.
0
Scott
Top achievements
Rank 2
answered on 22 Mar 2018, 06:41 PM
There is a 404 on the Hide Messages link
0
Veselin Tsvetanov
Telerik team
answered on 26 Mar 2018, 12:28 PM
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.
0
Scott
Top achievements
Rank 2
answered on 26 Mar 2018, 12:50 PM
it works, thank you!
0
Fat
Top achievements
Rank 1
answered on 09 Jul 2020, 06:26 AM
Thanks for your share!
Tags
Integration with other JS libraries
Asked by
Rajesh
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Rajesh
Top achievements
Rank 1
Scott
Top achievements
Rank 2
Veselin Tsvetanov
Telerik team
Fat
Top achievements
Rank 1
Share this question
or