Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ookma-Kyi's avatar

Getting error when clicking button to transition in a multistep form

I am getting the following error when clicking on the next button for a multistep form:

Here is my view:

I am using Quickdraw Larry's suggestion of using multiple forms and url's and passing the previous forms data to the next step.I am not using this anywhere in my code.

Any ideas?

0 likes
1 reply
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58

The error you're encountering, TypeError: this is undefined, is likely due to the use of this in the nextStep function. In Vue 3's <script setup>, the this keyword is not available as it is in the Options API. Instead, you should directly reference the variables and functions.

In your nextStep function, you are trying to access this.form, but this is not defined in the context of <script setup>. You should directly use the form variable.

Here's the corrected code:

Explanation:

  1. Remove this: In the nextStep function, replace this.form with form.
  2. Direct Reference: In Vue 3's <script setup>, you can directly reference the variables and functions without using this.

This should resolve the TypeError: this is undefined error you are encountering.

Please or to participate in this conversation.