Hello! I'm learning UXPin and I'm trying to create an interaction where the button changes states when all the input fields are entered. I want my button to change from inactive to active. I put conditions in the button interactions but it doesn't seem to be working! Any help would be great!
https://preview.uxpin.com/0d0e643a8200a1792ce259e3e44c4c402818e7e3#/pages/162968086
Hi Kevin,
It's fantastic to hear you're getting to know our tool! You're trying to create an interaction where the button changes states based on input fields. Let's get that working!
Instead of directly using the "Set state" interaction on the button, let's use variables and set interactions on the canvas. Here's what to do:
For instance, the username input field should have this interaction: Value Change -> Set Variable -> variable: username -> as Content of username Input field.
For other fields, simply copy and paste interaction (you can use shortcuts
cmd + SHIFT + C
cmd + SHIFT + V)
and modify the target variable accordingly. This video has a step-by-step guide.a) Unselect all elements and head to the interactions panel.
b) Choose Trigger: Variable Change; Action: Set State
Variable Change -> variable: username -> add conditions -> Set State -> button -> to "active"
Or you can copy this from the button like this and switch the trigger to "Variable Change".
c) Copy the interaction and switch variables in each one. Check out this tutorial video.
Give these steps a shot, and let me know if you need more help or have questions.
Happy exploring!
Thank you for the help Natalia! I really appreciate it! I added the interactions to the input fields and to the page itself with if, else statements but for some reason it still doesn't work.
https://preview.uxpin.com/0d0e643a8200a1792ce259e3e44c4c402818e7e3#/pages/162968086
No worries! Everything looks good with the variable setup. The button changes states correctly based on the inputs' values provided.
But I noticed that the "Go to Page" interaction was removed from the button in its "active" state, which is why it's not redirecting you to the next page. Once you add it, everything should work like a charm!
But the button doesn't change to the active state once all the fields are filled
https://preview.uxpin.com/0d0e643a8200a1792ce259e3e44c4c402818e7e3#/pages/162968086