Changing the name of a button in jquery-steps
If the label / text of the buttons should change dynamically depending on the language, you can use this:
/* dynamic change prev-next button text language (check lang attribute in html tag) */
var language = $('html').attr('lang');
$(window).on('load', function () {
if(language != 'de'){
$('a[href$="next"]').text('Next');
} else {
$('a[href$="next"]').text('Weiter');
}
});
You can do this:
form.steps({
headerTag: "h4",
bodyTag: "section",
transitionEffect: "fade",
labels:
{
finish: "Go",
},
onStepChanging: function (event, currentIndex, newIndex)
{
//change color of the Go button
$('.actions > ul > li:last-child a').css('background-color', '#f89406');
form.validate().settings.ignore = ":disabled";
return form.valid();
},
onFinishing: function (event, currentIndex)
{
form.validate().settings.ignore = ":disabled";
return form.valid();
},
onFinished: function (event, currentIndex)
{
form.submit();
}
});
Check out the following link. You can change all labels on initialization.
var settings = {
labels: {
current: "current step:",
pagination: "Pagination",
finish: "Finish",
next: "Next",
previous: "Previous",
loading: "Loading ..."
}
};
$("#wizard").steps(settings);`
I just needed to change button text depending on condition. And it can be done without changing settings just like that
if(true){
$('a[href$="finish"]').text('Go');
}else{
$('a[href$="finish"]').text('No Go');
}