How can we show a mandatory message on a text field when the submit button is clicked?

Hi team, I created a Page with 2 input text fields and provided messages mandatory for each. When I click on the button if there are any fields empty then we want to show that message and stop to move to the next page.
If all the fields are filled with data then easy to move to the next page.

You can use Data Validation task to achieve this functionality, steps are provided in below post :
Data validation task not working on dropdown