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

Skipping a step but not next step #23

Closed mycs7 closed 12 years ago

mycs7 commented 12 years ago

Hi,

I have a form with steps B, C, D, E, F ... with a radio on step B, if i select one of the 2 choices i have to be able to see step G after F if i choose the oder i have to jump from step F to H but i can't find a way to do it....is there a way to do this?

thecodemine commented 12 years ago

Hi,

one way would be to put a hidden link on step F which would tell the wizard where to go when the next button is clicked. e.g.

<input id="step_toggler" type="hidden" value="G" class="link" />

and when the radio buttons changes value you change the value of the step_toggler. e.g.

$("#radio_id").change(function(){
    $("#step_toggler").val($(this).val());
})

note, here I assume that the value of the radio has the value of the step id that it should show (G or H).

Does this make sense?

mycs7 commented 12 years ago

Yes it works, thanks a lot.

thecodemine commented 12 years ago

Great!