Reset or Clear BootStrap authentication messages when we open and close the popup

I am using bootstrap Validation for the form. This works fine except for one problem.

Without entering anything in the text, if you click "Save", the Validation message appears , click the "Close" button and restart Modal, initially it displays the Validation message

$('#taginsertform').bootstrapValidator(
{
        feedbackIcons:
        {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
        },
        fields:
        {
                recipientname:
                {
                        feedbackIcons: 'false',
                        validators:
                        {
                                notEmpty:
                                {
                                        message: 'Reciepnt Name cannot be empty'
                                }
                        }
                }
        }
}).on('success.form.bv', function(e)
{
        e.preventDefault();
        addTagSbmt();
});

This is my violin

http://jsfiddle.net/xmrxbL9f/74/

+4
source share
1 answer

Try replacing an event.

shown.bs.modal

with

hide.bs.modal

therefore, validation errors are cleared when the user closes the modal, and not yet openly.

See this script

+3

Source: https://habr.com/ru/post/1660066/


All Articles