0

I have a problem where I need to change the form based on if the user has entered some information.

I need to remove each step from jQuery steps except for the step the user is currently on and then add a brand new step

I am having no problem removing the steps but when I run my insert command nothing happens.

_self.form.steps("remove",1);
_self.form.steps("remove",2);
_self.form.steps("remove",3);
_self.form.steps("remove",4);


_self.form.steps("Insert",5, {
    title:"Test Head",  
    content: "<p>Test</P>" 
});

if I place an alert before the Insert it will show however if I place it after the Insert it does not. Any idea where I am going wrong with this?

Nikolay Kostov
  • 16,433
  • 23
  • 85
  • 123
jgok222
  • 314
  • 7
  • 23

1 Answers1

1

I see a little typo in your code. The insert method name must be in lowercase as we can see in the documentation:

insert Inserts a new step to a specific position. (chainable)

Here is JSFiddle with the example where the second step is deleted and a new step is inserted at this place:

http://jsfiddle.net/SashkaCosmonaut/mzuc7mxL/1/

(Sorry for the style, I don't know why it looks like that...)

SashkaCosmonaut
  • 413
  • 8
  • 18
  • Thanks for the example. I also noticed that the main problem I was having was I am not able to insert a step 5 if steps 1-4 no longer exist – jgok222 Feb 10 '15 at 17:15