Why does jQuery validation plugin configuration override after initialisation not work? -


I am trying to set up the form validation. My plan is to initialize the page with the configured identity object and reset it's configuration for my needs when necessary. But it does not work as expected, after initialization it does not accept a new configuration object. Here's my code:

  & lt; Form id = "testform" & gt; & Lt; Input type = "text" name = "myField" value = "" id = "myFieldID" class = "myFieldClass" placeholder = "type something ..." title = "Please fill my field" /> & Lt; Input type = "submit" class = "validate" name = "submit" value = "test" /> & Lt; / Form & gt; & Lt; Script & gt; Var Validator = $ ('# testform') Validate ({debug: true}); Validator = $ ('# testform') Validate ({Debug: False, Rule: {myField: "Required"}, Message: {myField: "Hello Other!"}}); & Lt; / Script & gt;  

After the initialization, after dump the verifier object, it does not debug: true and no other rule keeps showing the message. For that, I examined the author's document above and below and searched for this forum but did not get a satisfactory answer.

Anyone can teach me here / why it does not work and how to do it correctly, please?

It seems that it was designed to configure only once. There is a rule () method of changing the rules, if you want it all. However, this reference stores the validator's reference in the data library. We can clear that reference with $ ('# testform'). Data ('validator', blank); This script is about to run the setup to run the setup, so test it to make sure it does not go crazy.


Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

class - Kivy: how to instantiate a dynamic classes in python -