The validationEngine JavaScript plugin does not stop a form with a custom submit event from being submitted

I'm currently using validationEngine to validate a form before submitting it;

add-on

Everything works smoothly except when I create my own submit event handler for the form.

For example,

<form id="form" action="controller/action" method="post"></form>

$('#form').submit(function() {
      $.ajax({
        url: form.attr('action'),
        type: form.attr('method'),
        success: function (response) {
            success(response);
        }
    });
});

The validation is triggered, but the form gets submitted regardless. I have also attempted to check the returned value with:

alert($("#formUpdStoringSettings").validationEngine('validate'));

It always returns true for forms and false for fields, indicating that the validation is successful.

Is there any workaround for this issue as I must retain my custom submit event?

Answer №1

It has been discovered that the validationEngine is designed to validate forms while the user interacts with them, rather than waiting for the submit event.

As a result, I had to develop my own validation functions.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the most efficient way to dynamically alter the position of a div element within an HTML document using

In a scenario where a parent div contains multiple child divs, it is required that one particular child div named .div_object_last always stays at the end. Below is an example setup : HTML <div class="div_parent"> <div class="div_object"> ...

Retrieving data with comparable column values using pattern matching

I have a table called cities which contains various records such as: Name Value id 62 name New York id 63 name Paris id 64 name Tokyo There are many more records but the structure remains consistent. In my Node.js API, I receive a city n ...

Using Angular and C#, learn how to efficiently incorporate functionality for saving lists, including the addition, removal, and saving of items

I am working on an application that involves managing a list of objects within a web view. Upon loading the page, an AJAX request is triggered to an ASP MVC controller. The controller utilizes Entity Framework to retrieve the list of objects from a SQL se ...

I keep encountering an error in the console log, any tips on resolving it?

Whenever I use replit, the console log keeps indicating that a script is missing every time I attempt to run it. Despite having run = "npm start" in the replit file, running it prompts an error saying that the script "start" is not found. You c ...

I am interested in having the push notification feature function specifically for registered users

In an attempt to register the device for push notification using the PhoneGap plugin, I am encountering an issue. After the AJAX success action is called, the registration action does not alert the registration ID. Can someone help figure out what's g ...

I am struggling to locate the source of this mysterious middleware error

I seem to be encountering an issue with a middleware function, resulting in a "middleware is not a function" error message. I'm at a loss as to why this is happening... [Error] TypeError: middleware is not a function Routes JS import express from &ap ...

The callback functions designed to ascertain non-conflicting time ranges are harmoniously aligned

Suppose I have a JSON dataset of events, each with start and end times, and I want to create a function that generates time ranges without conflicts. For example, if the dataset includes 0800-0845, 1200-1230, 1140-1240, 1430-1530, etc., how can I gray ou ...

Tips for identifying unique digits within numbers

I've encountered an issue with my function that splits the input value on space and then loops through to search for numbers. However, only the last value is shown as checked, not the ones before it. One solution I found was to remove the else statem ...

Exploring the dissimilarities between using devtools::load_all and the manual loading of functions

In the process of developing a package that utilizes the validate package, I am creating a custom function to run validations. Here is the function I have written: validate_run <- function() { rules <- validator( speed >= 0, ...

Utilize jQuery post to send a request to a particular function located at a given URL

Is there a way to accomplish the following: $.post( "functions.php", { name: "John", time: "2pm" }) .done(function( data ) { alert( "Data Loaded: " + data ); }); Instead, is it possible to direct your data to a particular function in "functions.p ...

Is feedback being generated during a PHP function? (Possibly through AJAX?)

Greetings fellow developers! I've successfully created a php script that saves URLs submitted through a form to a zipped archive. However, there's a slight inconvenience when a user submits the form with a large number of URLs, as they have ...

Creating Bootstrap Popover dynamically on a jQuery DataTable is a straightforward process that can enhance user experience

I am currently populating a table with data retrieved from an ajax call. The filling process is done through the use of append method as shown below: var table = //something //loop through ajax response objects table.append('<tr><td>&apo ...

Create an eye-catching table layout and a user-friendly search tool

Is there a way to include a Search Text Box inside a table layout, similar to the image provided? I tried adapting this example for my table Demo, but it doesn't meet my requirements. Some CSS modifications are needed to enhance... In the example ab ...

The anticipated input was a string type, but a BoundField was encountered in Django

Django version: 2.0 python: 3.7 jquery : 3.3.1 bootstrap: 3.3.7 I have integrated ajax into my Django forms by following a tutorial found here. However, I encountered an unusual error when attempting to create a new book or update an existing one. "Expec ...

Conceal the loading spinner in JQuery once the image has finished loading

I am working with a jQuery function that captures the URL of an image link and displays the image. However, my issue lies in managing the loading process. I would like to display a LOADING message and hide it once the image has fully loaded, but I am strug ...

To include a Material Icon in your React-Toastify notification

This is an example of code located in a specific folder. While trying to incorporate a material Icon, an error has been encountered. 'React' must be in scope when using JSX import { toast } from 'react-toastify'; import ErrorIcon from ...

What is the process for loading data with no input provided?

I have come across a situation where my HTML table is populated with various account numbers. https://i.sstatic.net/qJc2E.png When I input the account number 979545130406, the filter works perfectly fine. https://i.sstatic.net/Y4Rwk.png However, the is ...

CSS: Creating a dynamic layout to center the card on screens of all sizes

My code currently places the profile card in the center of the screen regardless of screen size, but it often appears too small. How can I adjust the positioning of the profile card to almost fill the screen? @import url("https://fonts.googleapis.com/cs ...

Fundamental JavaScript feature experiencing functionality issues

Greetings, this is my debut in this space and I am encountering some challenges as a beginner in the world of coding. It seems that passing arguments to parameters is where I'm hitting a roadblock, or perhaps there's a simple detail that I'm ...

Simple steps to convert Redux state to Redux Persist with the help of 'combineReducers' function

I'm facing a challenge trying to implement Redux-Persist with my Redux state, particularly because I am using combineReducers. Here is the structure of my store: import { createStore, combineReducers } from 'redux' import { usersReducer } fr ...