submitComplete function prevents information to show up

submitComplete function prevents information to show up

MadMax76MadMax76 Posts: 149Questions: 33Answers: 1

Hi,

I have this in my editor:

editor_pos
                .on('submitComplete', function () {
                    ajax_call('__plugName__', 'erneuern');
                } );

reason is I need to refresh the page after changes due to some tests made when loading the page.

But: This prevents error messages like this

            ->validator( 'Validate::numeric', array(
                'decimal'=> ',',
                'message'=> 'Bitte den Nettobetrag eingeben!'
            ))

from showing up. The page loads new when clicking "Enter", and the error message is there for half a second before that but noone could read that.

Can I change this behaviour, e.g. calling the function only when there is no error mesage?

Thanks
Max

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,438Questions: 1Answers: 10,052 Site admin
    Answer ✓

    Hi Max,

    Rather than using submitComplete, which will trigger regardless of validation, use submitSuccess which will run only when everything happened successfully.

    Allan

  • MadMax76MadMax76 Posts: 149Questions: 33Answers: 1

    thanks!

Sign In or Register to comment.