I have included the jquery-steps plugin.
How can I change the buttons texts?
Now it says "finish" I want to change that into "go"
Thanks
I have included the jquery-steps plugin.
How can I change the buttons texts?
Now it says "finish" I want to change that into "go"
Thanks
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');
}
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();
}
});
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');
}
});
© 2022 - 2024 — McMap. All rights reserved.