What happens if rules are applied multiple time to a form
NickName:Manish Makkad Ask DateTime:2016-08-02T20:00:03

What happens if rules are applied multiple time to a form

This is more of a generic question, please remove it if this is not a correct platform.

My question is what happens if rules are applied to html form multiple time. like every time user clicks on button if rules are applied what will be the impact.

I am pretty sure such things won't happen but in case if we do that will browser go for a memory leak.?

Below is a sample validaiton.

    $("#fromValidate").validate({
                rules: {
                    txtName: { required: true }
                },
                messages: {
                    txtName: { required: "Please Enter Name." }
                },
                ignore: []
            });

If above rules are called everytime user clicks the button what will be the impact?

Copyright Notice:Content Author:「Manish Makkad」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/38719861/what-happens-if-rules-are-applied-multiple-time-to-a-form

Answers
Randy 2016-08-02T12:03:26

Your method is quite simple, it will run, validate, and exit. No memory will be used, apart from the first time the button is clicked and the validation method is being set.\n\nIf you would store those validation rules in an array and append to that array every time the button is clicked, the memory will fill. But that is not the case.\n\nEven if that would be the case, these functions seem so simple you won't run into problems. This is pretty safe.",


More about “What happens if rules are applied multiple time to a form” related questions

What happens if rules are applied multiple time to a form

This is more of a generic question, please remove it if this is not a correct platform. My question is what happens if rules are applied to html form multiple time. like every time user clicks on ...

Show Detail

jQuery Form Validation plugin with multiple rules

I'm using the jQueryValidation plugin. Problem: I would like to use multiple pattern rules within for one input field. E.g.: $("form").validate({ rules: { "email": { required: true, ...

Show Detail

What happens to unused css rules?

I have a style.css file and almost every component on the website is using rules from this file, but not always for example I have a main template and then a section where requested pages are displ...

Show Detail

IPTables rules being applied multiple times at startup

Specifically talking about an Ubuntu 10.04 LTS server (Lucid Lynx), although its probably applicable to other Linux versions. I was trawling through the logs for a few websites, doing some spring

Show Detail

Angular form rules

I am using Angular13 as a frontend and Laravel as a backend. We are creating multiple forms for users registration for courses the main cause is each form can have multiple discount rules, fields r...

Show Detail

Where in the O365 mail flow is the Tenant Allow/Block List rules and Journal rules applied

Based on this diagram, does anyone know at what point the following O365 features are applied? When are Tenant Allow/Block list exceptions applied to a message? I think it happens after Anti-Malw...

Show Detail

CSS rules applied after HTML content is loaded

I have a web app for mobile devices. It is a single page application, so it uses a pretty big index file along with 3 huge CSS files. In some pages the CSS rules are applied after the content is ...

Show Detail

magento catalog price rules not applied

Magento 1.3.2.4 catalog price rules stopped applying after website was moved to another server. Cron job is not giving any errors, however PHP version on a new server is higher. The only thought that

Show Detail

Passing multiple callback in Code Igniter form validation rules

I want to pass multiple callbacks in codeigniter form validation rules.... but only one of the callbacks work I am using this syntax in my contoller $this->form_validation->set_rules( ...

Show Detail

Export firewall rules applied from GPO using powerhsell

I am using the code below to export locally applied firewall rules to a .csv. $Rules=(New-object –comObject HNetCfg.FwPolicy2).rules $Rules | export-csv test.csv -NoTypeInformation This script d...

Show Detail