0

I have jQuery notify that posts warning messages based on certain selections: What I need to do is to not to submit the form when the warning/notification message shows up. Only when the error is resolved, is to submit the form.

  $('.Reason').change(function(event)
    {
        var id = $(this).data('item-id');
        var sPrice = $(this).data('price');
        var reason = $(this).val();
        var aPrice = $(this).data('aPrice');


        if (reason > 0 && (aPrice == sPrice)){

            $('##' + id).notify(
            {
                title: 'Warning',
                text: "Both pricing can't match, Please fix before conitniuing.",
                image: '<i class="fa fa-2x fa-exclamation-circle"></i>'
            },
            {
                style: 'cosentino',
                className: 'error',
                position: 'top center',
                clickToHide: true,
                autoHide: false
            });

        }

       $('##frmJobEntry').validate(
        {
            errorClass: 'JoblineInlineError'
        });
Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98
user2675939
  • 361
  • 2
  • 6
  • 22
  • I am unable to see form submission code. Though use `return false;` in those code where you are adding warning code. `return false;` will prevent form submission. `event.preventDefault()` can be use as well – Alive to die - Anant Mar 28 '20 at 23:05
  • I created another since mine involves using notify to show warning messages, I can't really use return false there, its not working – user2675939 Mar 29 '20 at 16:29

0 Answers0