Issue with Client-Side Validation and Display in Yii2 Form

I’m facing a peculiar issue with my Yii2 application. Here’s a concise summary:

Problem: I’ve implemented a scenario where a page is rendered based on the selected option in the frontend. The scenario is working, but the red asterisk, help text, and model validation are not functioning as expected.

Details:

  • When the option is selected, the page is correctly rendered.
  • However, the required field indicator (red asterisk) is not showing up.
  • The help text associated with the field is not displaying.
  • Model validation is not triggering on the client side as intended.

Request for Help: Has anyone encountered a similar situation? Any insights or suggestions on how to address this issue would be greatly appreciated!

Thank you in advance for your assistance! :pray:

If other pages work as expected, my guess is this may be related to AppAsset and the page you want to render .
AppAsset is declared and registered in the layout (views/layouts/main.php).

If not, try to isolate the problem and show us the code.

I have written a onchange function and based on onchange both the pages are rendered but the requried asterisk and help text that comes when we blur on the input field is not working, Also I want the validation on clicking the submit button that doesn’t prevent it going forward that is also not happening