Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Reset Search

Locked
daniel
Posts: 2
Joined: Fri Sep 06, 2013 9:04 pm

Reset Search

Unread post by daniel »

Hello,

Just wondering if there is a way to reset a search, or to clear out the search box by clicking a button?

Thanks,
Dan

PS. Great product!
zazzium
Posts: 84
Joined: Mon Jul 04, 2011 12:52 am

Re: Reset Search

Unread post by zazzium »

Hi,
actually, it's pretty easy.

Copy the code to Custom Code-> Before Browse

Code: Select all

$js = "
$(document).ready(function(){
var reset_search_bt_name = 'Reset'; //reset button name
var reset_search_bt = '<button class=\"actionButton\" id=\"reset_searh_bt\">'+reset_search_bt_name+'</button>'
$('#actionButtons').append(reset_search_bt);
$('#reset_searh_bt').click(function(){
$('#search').val('');
changeAction();
$('#thebrowse').submit();
});
});
";
addJSfunction($js);
(if you want all the brows forms have this, you have to modify the source code)

zazzium
daniel
Posts: 2
Joined: Fri Sep 06, 2013 9:04 pm

Re: Reset Search

Unread post by daniel »

Awesome, works perfectly. Thanks!
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Reset Search

Unread post by massiws »

.
Locked