Home > database >  Reset ninja form fields after bootstrap modal close
Reset ninja form fields after bootstrap modal close

Time:09-17

I have modal with ninja form inside:

<!-- Modal -->
<div class="modal fade" id="vakancesModal" tabindex="-1" aria-labelledby="vakancesModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body sazinaties-ar-mums-form">
    <?php echo do_shortcode('[ninja_form id=5]') ?>
            </div>
        </div>
    </div>
</div>

I want on modal close reset form with jquery or javascript

$('#vakancesModal').on('hidden.bs.modal', function(e) {
 
//nija form reset js or jquery

});

Ninja form documentation is very poor, so I can not find any solution to reset form...

CodePudding user response:

jQuery('#vakancesModal').on('hidden.bs.modal', function (e) {
     //nija form reset js or jquery
     jQuery('#nf-form-5-cont form').attr("style", "display: inline !important");
     jQuery('.nf-response-msg').attr("style", "display: none !important");
});
  • Related