How can I add my custom submit button in the place of submit button jQuery Steps?

夙愿已清 提交于 2020-02-07 03:58:27

问题


I am using toolsets(https://toolset.com/) CRED form to create a post. I have also used jQuery Steps to divide the form into multiple steps.

My Form looks something like this: https://imgur.com/eEz3VJC

$("#example-vertical").steps({
    headerTag: "h3",
    bodyTag: "section",
    transitionEffect: "slideLeft",
    stepsOrientation: "vertical",
    enableFinishButton: false,
    enableAllSteps: true,
    onStepChanged: function (event, currentIndex, priorIndex) {
      if(currentIndex == 3){
    submitButton = document.querySelector(".wpt-form-submit")
    submitButton.classList.add("mystyle");    
      }
   } 
});

You can see that I added a fix that when someone reached 4th step the submit button is set to display: block

I want to add it to after the next and previous button and only when the someone is at the last step.

Things get tricky here because, as I am using toolset the from is created using their shortocode so this is the shortcode that renders to the submit button.

<div class="form_submit">
[cred_field field='form_submit' output='bootstrap' value='Submit' class='btn btn-primary btn-lg']
</div>

How do I add the after the next button or as to say how can I make this the part of JQuery steps? The result I want is here : https://imgur.com/kr3Jat1

来源:https://stackoverflow.com/questions/57622183/how-can-i-add-my-custom-submit-button-in-the-place-of-submit-button-jquery-steps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!