thecodemine / formwizard

jQuery plugin based on top of jQuery UI which turns a form into a multistep wizard. Integrates with the jQuery form plugin for AJAX submission of the form, the validation plugin for client side validation and the BBQ plugin for enabling the browsers back and forward buttons.
140 stars 54 forks source link

Validation issue #7

Closed mcockrell closed 13 years ago

mcockrell commented 13 years ago

Hey, first off, thanks for the great plugin.

Secondly, I'm noticing a weird issue with the validation plugin in conjunction with this. I am coding in asp.net so as you know, i unfortunately have one form tag that wraps my entire page. Not a huge issue for my implementation of this, as i can set the plugin to do $("#form1").formwizard(); and it finds my steps and makes the wizard. Everything works when i initialize the plugin like that, specificing the form id as the selector.

However, if i set the plugin to the wrapping container like $("#stepscontainer").formwizard(); the wizard is created successfully, but upon hitting any buttons within the form for navigation, i get a javascript error of validator is undefined.

I'm not sure what's going on with this, if it's a validator bug (since you are passing my selector to the validator, and the validator is not being able to initialize on an element (like it needs the form??). or if it's a bug within the formwizard, like it should always just pass the form element to the validator instead of the specified selector.

Thoughts?

Thanks!

thecodemine commented 13 years ago

Hi,

yes, you are quite right that the formwizard plugin assumes that the selector is actually a form. And in turn, this form is then passed to the validtion plugin (which it requires). As of now, no plans have been made to change this behavior and hopefully you can use the form id in your implementation. Hope this clarifies things. If you need further assistance you can contact me directly at my email jan.sundman[at]aland.net.

Br,

/Jan

mcockrell commented 13 years ago

Understandable. I may fork and.make a modification where it checks the passed selector is actually the form and if not find its parent form and pass that. Should be an easy change. If I am successful would you be interested in a pull req

thecodemine commented 13 years ago

As you say, the change is quite straight forward, so a pull request should not be needed if this is decided to be the way forward. In any case, thank you very much for your input (and sorry for replying so late).