Yii form not validating
PHP side of Active Form, which is usually more than enough for majority of projects, is described well in the official Yii 2.0 guide.It is getting a bit more tricky when it comes to advanced things such as adding or removing form fields dynamically or triggering individual field validation using unusual conditions.
So I also needed to have them enter the Gravatar email address. Here is the final code (note: I still needed the Finally, it works like a charm. I uncheck the checkbox, email input goes green because it's no longer required..After the input fields, the yii\helpers\Html::submit Button() method is called to generate a submit button.To see how it works, use your browser to access the following URL: You will see a page displaying a form with two input fields.In this recipe you'll be introduced to Active Form Java Script API.We're going to use basic project template contact form for trying things out so install it first.