Search code examples
jquerydomjquery-validatedynamicformwizard

jquery formwizard + validation plugin, dynamically added fields not validated


This is my third post on this project already -it's a tough one!

I'm using the JQuery FormWizard plugin in combination with its built-in validation options.

Now, I'm using the FW plugin's default method for adding steps to the wizard (as found on http://thecodemine.org/examples/example_15_add_and_remove_steps_dynamically.html), but any steps I've added don't seem to be validated! I found the validator.refresh() method but that's deprecated, and I've tried something I found on this forum:

$('#newfield').rules('add', {
    required: true
});

...but still no effect. Has anyone come across a problem like this?


Solution

  • I found the problem. I replaced the standard 'next' button with one of my own (I needed to skip the step after the newly added step), and apparently the 'show' method of the formwizard doesn't bother to validate.

    ...and I forgot I replaced the button :$