Change value of a field based on another field
I have form with some questions. I am making the field disabled if checkbox isnt checked. I want to make this possible via tanstack-form but couldnt manage to do it except useEffect. Any suggestions?


3 Replies
sensitive-blueOP•2mo ago
I also want to add, there is a property canSubmit in form.state. Using tanstack-form, this cansubmit property is always false but using useffect, it nay be true if there is no validation error

unwilling-turquoise•2mo ago
If it's dependent on another field, you have multiple options:
1. Access the value inside the checkbox
2. Use Subscribe to check the up to date value
3. Use
useStore
for a reactive value without the need for useEffect
sensitive-blueOP•2mo ago
thanks a lot for the answer