I want to add a clear button to the search textbox in my application. Is there a ready Ajax extender or a JQuery functionality to implement that?
Thanks in advance.
There's nothing out of the box, but it's easy to create something like this using no extra HTML, some CSS magic and jQuery to bind events.
My example uses this HTML
<input type="text" name="search" id="search" value="I can be cleared" /><!-- --><a href="search/clear" id="clear">Clear results</a>
If you put anchor tag right after input, you can easily omit the comment which is used to remove space between inline elements.
CSS then positions the link with negative margins so it displays inside the text input box. It's not really inside because input is not a container. It's just a visual trick.
For the rest of code simply check JSFiddle example.