Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Searchbar control

how can I determine when the clear button of a search bar is clicked

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Searchbar control

Hello,

Please try to add next code to page load event
pre
$(document).on('click', '.ui-input-clear', function () {
alert('cleared');
});
/pre

Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Searchbar control

Works great....Thanks

Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Searchbar control

This appears to trap the entire app. Is there a way to do this by page?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Searchbar control

Hello Roger,

Please try this code:

code$("[dsid='startScreen']").on('click', '.ui-input-clear', function () {
alert('cleared');
});
//where startScreen - name of page /code

Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Searchbar control

This seems to work just fine.

$(document).on('click', '#PriceMaint .ui-input-clear', function () {

});

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Searchbar control

Roger,

Thank you for the update. Let us know if you need any further help.

Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Searchbar control

Great, THANK YOU!!

Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Searchbar control

The following works by page. But now within a page it will grab and control with .ui-input-clear. I would like to limit the code below for searchbar controls. Is that possible?

$(document).on('click', '#PriceMaint .ui-input-clear', function () {

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Searchbar control

Hello Roger,

Could you please try this one:

code$(document).on('click', 'div.startScreen_mobilesearchbar_2 .ui-input-clear', function () {
alert('cleared');
}); /code

//where startScreen - name of pageg
mobilesearchbar_2 - name of searchbar

Return to “Issues”