Rad wizard next button text

1 Answer 381 Views
Wizard
Itamar
Top achievements
Rank 1
Iron
Iron
Itamar asked on 26 Jul 2021, 10:32 AM

Very simple but cant find a way to do it:

I have a rad wizard and want custon text in the "Next" button in the second step....

1 Answer, 1 is accepted

Sort by
1
Accepted
Vessy
Telerik team
answered on 28 Jul 2021, 04:59 PM

Hi Itamar,

The Next button of RadWizard is common for all steps, but you can change its text dynamically when the active step is changed. For example, you can do that in the OnClientButtonClicked event of the control:

            <script>
                function onButtonClicked(wizard, args) {
                    var secondStepTitle = "Second step Title";

                    wizard.get_nextButtonElement().innerText = "Next";

                    if (wizard.get_activeWizardStep().get_title() == secondStepTitle) {
                        wizard.get_nextButtonElement().innerText = "Custom Next"
                    }
                }
            </script>

            <telerik:RadWizard RenderMode="Lightweight" ID="RadWizard1" runat="server" Height="420px" OnClientButtonClicked="onButtonClicked">
                <WizardSteps>
                ....

Regards,
Vessy
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Itamar
Top achievements
Rank 1
Iron
Iron
commented on 29 Jul 2021, 04:09 PM

Thanks so much this is really helpful!
Vessy
Telerik team
commented on 30 Jul 2021, 05:38 AM

You are welcome, Itamar :)
Itamar
Top achievements
Rank 1
Iron
Iron
commented on 16 Aug 2021, 10:44 AM

Hey unfortunately this approach doesnt seem to be working,the function runs but the buttons text remains the same , also if i change my 2nd(of 3 steps) to "Steptype -finish" the next button remains on the page.... cant get rid of it

 

Vessy
Telerik team
commented on 18 Aug 2021, 03:55 PM

Hello Itamar, 

I tested the suggested sample and it behaves properly at my end. Please, note, that the Finish button remains when the StepType="Finish". If you want to have a final step without any buttons, you will need to set the StepType="Complete" like demonstrated in the following video:

http://somup.com/crjFoMYRut

Below you can see the setup I used for my the video above:

        <script>
            function onButtonClicked(wizard, args) {
                var secondStepTitle = "Second step Title";

                wizard.get_nextButtonElement().innerText = "Next";

                if (wizard.get_activeWizardStep().get_title() == secondStepTitle) {
                    wizard.get_nextButtonElement().innerText = "Custom Next"
                }
            }
        </script>
        <telerik:RadWizard ID="rwzSWAssessment" runat="server" Width="550px" 
            OnClientButtonClicked="onButtonClicked">
            <WizardSteps>
                <telerik:RadWizardStep Title="Start">
                    Step 1
                </telerik:RadWizardStep>
                <telerik:RadWizardStep Title="Second step Title">
                    Step 2
                </telerik:RadWizardStep>
                <telerik:RadWizardStep Title="F3">
                    Step 3
                </telerik:RadWizardStep>
                <telerik:RadWizardStep Title="F4">
                    Step 4
                </telerik:RadWizardStep>
                <telerik:RadWizardStep ID="rwsSummary" Title="Overall" StepType="Complete">
                    Complete!
                </telerik:RadWizardStep>
            </WizardSteps>
        </telerik:RadWizard>

 

Itamar
Top achievements
Rank 1
Iron
Iron
commented on 19 Aug 2021, 11:45 AM

Thanks !

 

Vessy
Telerik team
commented on 19 Aug 2021, 02:31 PM

Welcome :)
Tags
Wizard
Asked by
Itamar
Top achievements
Rank 1
Iron
Iron
Answers by
Vessy
Telerik team
Share this question
or