I have a webpage with a form when I submit that page I go into a controller...he check the data sent $data = $this->getRequest()->getPostValue();
And if one of the data isn't what I am expecting, i'm redirecting on the same url page with an error message.
$this->messageManager->addError($errorMessage);
return $resultRedirect->setUrl($this->_redirect->getRefererUrl());
This works fine.
But doing this, i'm loosing all the datas registered previously by the user (cause it's like if I was opening the url for the first time obviously).
I'm looking for a way to keep that data in the html so may be there is a different kind of redirect possible ?
To resume : Is it possible from php server side to reload a url by keeping the input values.