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

window retains textbox value even it is set to empty value

2 Answers 52 Views
Window
This is a migrated thread and some comments may be shown as answers.
Venkatakrishna
Top achievements
Rank 1
Venkatakrishna asked on 17 Feb 2012, 08:20 AM
Hello,

I have a link which will launch radwindow and the window contains a textbox, save and cancel buttons. If user clicks cancel button after entering some values in the textbox, we are closing the window in cancel click event.

the issue is, while user relaunch the window, textbox shows the value which has been entered previously. As per the requirement, textbox should not contain any values and it should have the focus while launching or relaunching the window. We also tried following solutions but nothing worked out.

1. clearing the textbox while closing the window
2. setting "true" to DestroyOnClose property.

Please help us.

Thanks
Venkat

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Feb 2012, 09:57 AM
Hello,

Try the following code.
JS:
function OnClientClick()
 {
   var RadWindow1= $find("<%=RadWindow1.ClientID %>");
   var HiddenField1= document.getElementById("HiddenField1");
   var TextBox1= HiddenField1.value;
   var TextBox1= document.getElementById(TextBox1);
   TextBox1.value = "";
   RadWindow1.close();
 }
Note: Here I added the ClientID of TextBox in a HiddenField and access that on client side.

Thanks,
Princy.
0
Venkatakrishna
Top achievements
Rank 1
answered on 17 Feb 2012, 12:44 PM
it did not work out since we used radTextBox, but we have resolved it by calling clear() method of radTextBox.

I appreciate your solution.

Thank you !
Venkat
Tags
Window
Asked by
Venkatakrishna
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Venkatakrishna
Top achievements
Rank 1
Share this question
or