Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Add "clearField" event when clearing input type="search" #4683

Closed
commadelimited opened this issue Jul 11, 2012 · 3 comments
Closed

Add "clearField" event when clearing input type="search" #4683

commadelimited opened this issue Jul 11, 2012 · 3 comments

Comments

@commadelimited
Copy link
Contributor

Currently when you have an input field with a type of search a small X button appears at the far right after text has been input.

When the X button is clicked, the button is removed and the field is cleared...this is happening through a simple method call rather than an event being fired.

This would allow users to perform other actions which might be necessary. It would also easily allow the jQM Autocomplete plugin to fire it's "clear" method after users have clicked the clear button.

I suggest triggering an event in this case.

Thoughts?

@jaspermdegroot
Copy link
Contributor

Related ticket: #2282

@jaspermdegroot
Copy link
Contributor

Hi @commadelimited - Thanks! I added it to https://github.com/jquery/jquery-mobile/wiki/Feature-Requests. Closing as a feature request for now.

@zanurano
Copy link

try this, hope help you

$("input[name=search-mini]").on("search", function() {
  //do something for search
});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants