window retains textbox value even it is set to empty value

3 posts, 0 answers
  1. Venkatakrishna
    Venkatakrishna avatar
    22 posts
    Member since:
    Jul 2010

    Posted 17 Feb 2012 Link to this post

    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. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 17 Feb 2012 Link to this post

    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.
  3. Venkatakrishna
    Venkatakrishna avatar
    22 posts
    Member since:
    Jul 2010

    Posted 17 Feb 2012 Link to this post

    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
Back to Top