Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 18, 2009 08:35 PM by 2177
Jun 18, 2009 03:28 PM|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|LINK
Clear Text box
For drop down
Jun 18, 2009 04:45 PM|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|LINK
Make sure that you are including the JQuery file in th page .
--- Put code here---
Jun 18, 2009 04:58 PM|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|LINK
Could you please tell me your mean by "include jquery file in the page"?
Jun 18, 2009 05:12 PM|LINK
you have to refer the JQuery file in your page
Jun 18, 2009 06:54 PM|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|LINK
Jun 18, 2009 08:35 PM|LINK
I got it...
Thanks a lot!