Hi Ricco,
This is how I solved
the problem thanks to Castor's code.
1. I downloaded the
“Reset Button” plugin
2. I created a new
“Reset Button” field which I added to the form where I had the
calendar fields
3. I had two
calendar fields in my form called search_date_from and search_date_to, so I adapted
Castor's code as follows:
<pre>
jQuery(document).ready(function(){
jQuery("#reset_search_form").click(function(){
var defaultText
= null;
jQuery("#search_date_from").val(defaultText);
jQuery("#search_date_from_hidden").val(defaultText);
jQuery("#search_date_to").val(defaultText);
jQuery("#search_date_to_hidden").val(defaultText);
alert("Hello
World");
return false;
});
});
</pre>
4. I edited the
Reset Button field and in the bottom right hand corner there is an
orange arrow you can click on to open the section called Stuff. Here
you can give a CSS class to your button ( btn-primary, etc if your
using a Bootstrap 3 template) and also insert some JavaScript in the
JS section → that's where I pasted the code
I hope this helps!