Hi,
Thanks for reaching out to us.
By default, there is no option for reset application form. But you can use the below code snippet.
add_action('awsm_application_form_field_init', 'awsm_application_form_reset');
if ( ! function_exists( 'awsm_application_form_reset' ) ) {
function awsm_application_form_reset() {
echo '<input type="button" id="awsm_reset_form" value="reset" />';
?>
<script>
jQuery(function($) {
var $form = $('.awsm-application-form');
var form = $form[0];
$('#awsm_reset_form').click(function() {
$form[0].reset();
});
});
</script>
<?php
}
}
Resources: https://wp-content.co/add-custom-code-to-your-wordpress-websites/
Regards
Nithin John
Hi Nithin John,
Thanks for prompt reply.
Sorry for the confusion.
Actually I would like to add in the reset button for the filter form not the application form.
I have found an alternative way to achieve it using javascript.
$('.resetcta').on('click', function(){
select.find('option:not([value=""])').prop('selected', false);
select.find('option[value=""]').prop('selected', true).trigger('change');
});
However, if there is any hooks to achieve it would open for advices.
-
This reply was modified 2 years, 11 months ago by
jacksn676.