We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how to clear the value of a textbox on closing the dialogbox

Thread ID:

Created:

Updated:

Platform:

Replies:

147161 Sep 3,2019 12:48 PM UTC Sep 4,2019 10:21 AM UTC Angular - EJ 2 1
loading
Tags: Dialog
thowfik
Asked On September 3, 2019 12:48 PM UTC

how to clear the value of a textbox on closing the dialogbox
Thanks in Advance 
Regards
Thowbik


Narayanasamy Panneer Selvam [Syncfusion]
Replied On September 4, 2019 10:21 AM UTC

Hi Thowfik, 
 
Greetings from Syncfusion support. 
 
Yes, you can clear text box value on closing dialog, By using dialog’s close event. On close event you can reset the textbox value by using its component instance. 
Please refer the code example in below, 

Html: 
<ejs-dialog #Dialog [header]='header' [showCloseIcon]='true' [target]='target' [width]='width' (close)="onClose()"> 
    <ng-template #content> 
        <ejs-textbox #textBox placeholder="First Name"></ejs-textbox> 
    </ng-template> 
</ejs-dialog> 
 
TS:  
@ViewChild('Dialog', null) public dialogObj: DialogComponent; 
@ViewChild('textBox', null) public textBoxObj: TextBoxComponent; 
 
. 
. 
. 
 
public onClose() { 
    this.textBoxObj.value = ""; 
} 
 
 
For your convenience we have prepared a sample, please get it from the below link, 
 
Regards, 
Narayanasamy P. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon