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

akvaskov's avatar

Placeholder clears data from previous steps of wizard

Hello all!

I have a wizard form. On the first step I have an input field and on the second - a placeholder controller (an some other inputs). I have realized that, when I submiting a form on the third step, the data from the first step isn't passed. But if I remove the placeholder on the second step, everythind works fine. Could you explein me if it's wrong or not?

public function getSteps(): array
    {
        return [
            Step::make('Product ID')
                ->description('Write a product id you want to spy')
                ->schema([
                    TextInput::make('product_id')
                        ->required()
                        ->reactive()
                        ->default(158292376)
                ]),
            Step::make('Confirmation')
                ->description('Check a product one more time and confirm you want to spy it')
                ->schema([
                    Placeholder::make('product_id')
                        ->content(new HtmlString('<div>Are you sure?</div>')),
                    TextInput::make('product_id_one_more_time')
                        ->default(158292376)
                ]),
            Step::make('Notifications')
                ->description('Define what actions to be notifyed')
                ->schema([
                    Toggle::make('notify_if_product_name_changed'),
                ]),
        ];
    }
0 likes
2 replies
akvaskov's avatar
akvaskov
OP
Best Answer
Level 1

I'm so sorry. I found this stupid mistake. The placeholder has the same ID as the input on the first step. Thus respective value is overwritten.

gych's avatar

@akvaskov Good that you found the issue ! :) Please don't forget to close your thread by marking your fix as best answer.

Please or to participate in this conversation.