Now, let’s add some magic with validations and conditions to make your form smart and responsive.
a. Select the *textinput1* component and navigate to its Visibility condition. Click on **fx** next to the Visibility condition and enter the below code in the input:
```javascript
{{components.form1.children.starrating1.value<4}}
```
*This code will ensure that the *textinput1* component is only visible when the start rating is below 4.*
b. Select the *textinput2* component and navigate to its Custom Validation property. Click on **fx** and enter the following code to test the email format using regex:
c. Select the *numberinput1* component and enable the toggle for Make this field mandatory. This setting will display an error when the *numberinput1* component is left blank.
d. Finally, the *button1* component has to be disabled if the rating, email, and contact fields are not valid. Use the following code in the component's Visibility condition to achieve that:
<imgsrc="/img/how-to/build-dynamic-forms/start-rating-condition-test.png"style={{paddingBottom:"25px",marginTop:'15px'}}alt="Dynamic Form UI - Test Star Rating"/>
<imgsrc="/img/how-to/build-dynamic-forms/start-rating-condition-test-2.png"style={{paddingBottom:"25px"}}alt="Dynamic Form UI - Test Star Rating 2"/>
2. Enter incorrect email and contact details to see whether the related components throw an error while disabling the button.
<imgsrc="/img/how-to/build-dynamic-forms/incorrect-email-and-contact-test.png"style={{paddingBottom:"25px",marginTop:'15px'}}alt="Dynamic Form UI - Incorrect Email and Contact Test"/>
This short guide covers the main validation options that you can use while creating a dynamic form. To explore further, use the Tabs component to create multi-page forms while using the same logic to make it dynamic.