Skip to main content
Solved

Conditional boolean for input?


rachel37

Hi guys, how to achieve this?
when on tap, If input = empty, set input to Mary

example scenario: user fill in form

  1. If name input = empty, set input to Mary
  2. If email input = empty, set input to mary@gmail.com
  3. if message input = empty, set input to Hi can you help me?
  4. if all inputs are filled, set button boolean value to true, then user able to click submit form.

Can this be done? then I don’t have to have 4 pages to do user testing, thanks! πŸ™‚

Best answer by Pavel_Kiselev

Alright, seems fairly easy to do

Figma – 2 Jul 23

You will need 3 vars to get it going

And here what interaction looks like (one field, others are the same)

If condition checks all the strings against desired value. If all set to what we need, then enable button

Button disabled state is bound to Boolean var

View original
This topic has been closed for comments

5 replies

rachel37
  • Author
  • 3 replies
  • July 2, 2023


Pavel_Kiselev
  • Power Member
  • 438 replies
  • Answer
  • July 2, 2023

Alright, seems fairly easy to do

Figma – 2 Jul 23

You will need 3 vars to get it going

And here what interaction looks like (one field, others are the same)

If condition checks all the strings against desired value. If all set to what we need, then enable button

Button disabled state is bound to Boolean var


rachel37
  • Author
  • 3 replies
  • July 2, 2023

Woah cool, thanks @Pavel_Kiselev I manage to get it working somewhat. Is it possible to make the initial input value to have no value at all? meaning no placeholder
βœ… Name : ( )
❌ Name: ( Enter name )

2nd question: how to reset the form to return to its initial value again?
so that user able to test action: removing the inputs
so that I don’t have to keep restart the prototype. 😁


Pavel_Kiselev

Np mate.

Play with component states for the former. It would make it a bit more complex, not sure by how much

And have another interaction to set initial var values for the former


  • 0 replies
  • August 1, 2023

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings