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

[Solved] RAD TEXTBOX JQUERY PROBLEM

2 Answers 159 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raghav Sharma
Top achievements
Rank 1
Raghav Sharma asked on 15 Sep 2009, 09:02 AM
Hello Everyone
        I am in A little problem I ahve on input screen where i placed the RADTextbox and RAdNumeric Textbox > I want to empty the textbox fields through jquery > i wrote the code its working but problem is that after empty the textbox when i go back and click the RAD Textbox then the Fileds are show again this problem is not in the simple asp Textbox please let me know if any solution
Here is code to empty the RADTextbox through Jquery
  1.    $(form).find('input.inputstyle').each(function() {
  2.                 this.value = '';
  3.             });
Thanks
Raghav Sharma

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 15 Sep 2009, 09:57 AM
Hi Raghav,

RadTextBoxes are more complex controls than regular asp:TextBoxes and you should clear (or set) the value by using the corresponding API methods:

http://www.telerik.com/help/aspnet-ajax/input_clientsideradtextbox.html

http://www.telerik.com/help/aspnet-ajax/input_clientsideradnumerictextbox.html


The problem in your case is that you are clearing the "visible" value of the control, but the value is stored in one more place and is retrieved from there upon focusing. If you prefer using jQuery in this case, you can try this:

$(form).find('input.inputstyle').each(function() {
    $find(this.id.replace('_text', '')).clear();
});

or

$(form).find('input.inputstyle').each(function() {
    this.value = '';
    $get(this.id.replace('_text', '')).value = '';
});


Using the last approach is not recommended, as it is practically a hack.


Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Raghav Sharma
Top achievements
Rank 1
answered on 15 Sep 2009, 10:09 AM
Hi Dimo
        Thanks for quickly Reply i really really appreciateand  its works properly I'll Realy looking forward it
Thnks again 
Raghav Sharma 
Tags
General Discussions
Asked by
Raghav Sharma
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Raghav Sharma
Top achievements
Rank 1
Share this question
or