Last post Jun 18, 2009 08:35 PM by 2177
Jun 18, 2009 03:28 PM|2177|LINK
I am new to the JQuery. I need to clear textboxes and set the first item in the dropdownlist. Could you please show me code to do so?
Jun 18, 2009 04:20 PM|RatheeshC|LINK
Clear Text box
For drop down
Jun 18, 2009 04:45 PM|2177|LINK
Thanks for a quick reply.
Well, I did exactly the way you have suggested. That is, $('#<%=txtCardHolder.ClientID %>').val('');
But it gives "Object expected" browser error.
Jun 18, 2009 04:55 PM|RatheeshC|LINK
Make sure that you are including the JQuery file in th page .
--- Put code here---
Jun 18, 2009 04:58 PM|Pawan_Mishra|LINK
use the following construct to cclear the value of textbox :- $('#<id of the textbox>').attr('value', '');
Note : text of textbox is actually displayed as value attribute in the markup so you need to use the attr() function and set the value property to empty.
Jun 18, 2009 05:09 PM|2177|LINK
Could you please tell me your mean by "include jquery file in the page"?
Jun 18, 2009 05:12 PM|RatheeshC|LINK
you have to refer the JQuery file in your page
Jun 18, 2009 06:54 PM|novogeek|LINK
As said above, if you are missing reference to jQuery file, you will get that error. If your controls are placed in nested controls(like in server side panels), you will face client side reference issues. This is the best way to eliminate such issues:
Hope it helps [:)]
Jun 18, 2009 06:55 PM|novogeek|LINK
Jun 18, 2009 08:35 PM|2177|LINK
I got it...
Thanks a lot!