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. Image for the cookie policy date
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:





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

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

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, 

<ejs-dialog #Dialog [header]='header' [showCloseIcon]='true' [target]='target' [width]='width' (close)="onClose()"> 
    <ng-template #content> 
        <ejs-textbox #textBox placeholder="First Name"></ejs-textbox> 
@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, 
Narayanasamy P. 


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