How to make an input equal another if someone checks a box

Hi!

I think my question’s very simple. I have an input for initial location and an input for final location. The final location should equal the initial location unless someone checks a checkbox to make the final location different.

When someone types in the initial location and the checkbox is unchecked, the final location should always display the same information as the initial location. When the checkbox is checked, they should be free to enter whatever they want.

What I have so far: The final location input field is disabled/grayed out when the checkbox is unchecked, and it’s white when the checkbox is checked. Initially when you go in the app the final location does display the same information as the initial location, and then if you check the checkbox you can edit it to whatever.

The problem: After the first time, if I try to uncheck the checkbox again (so I’ve changed my mind as a user and decided I do want the two locations to be the same), then the final location input field no longer tracks my edits to the initial location input field. It’s just stuck with whatever it said before I hit the checkbox.

Put a conditional onto your input that says if “checkbox is not checked” and then change it to have the initial content you want or disable it…checkout conditionals and see what you can do with them, they are very powerful