问题
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