Upvote 1

Clicked button adds text to screen

Answered Moonwalker95 5 years ago

Hi,

I would be very grateful if somebody could help me with my query.

My page has many buttons.

How could I achieve the following?

When each button is pushed, the word that it represents is added to a list on the bottom of the screen.

e.g. one button says 'cow'. When you push the button, the word "cow" appears at the bottom of the page. When you then push the 'pig' button, the bottom of the page now reads "cow, pig" etc.

How could I then send this list via an email at the click of a button?

Many thanks

Replies (1)
photo
2

Check out the attached prototype for an example. Here's what we did:

  1. For each button, we created an "On Click" + "Set Value" event, setting the value to a text element below. Here's the value we set:e40c78cf170d57e06b54e6f3a3fbca95
  2. The first space is the text element. We then use the 'Concatenate' function to add a comma after the text value, and then use it once more to add the value of the Button's value (in this case - 'Cat') we'd like to add.
  3. Create a condition for this event. Drag the text element to the open space in the expression, then an ≠ sign. Leave the last space blank. This condition means that the last event we created will only trigger when the text element isn't empty. We now need to create an alternative event to trigger when the text element IS empty.
  4. Click the 'Else' text and drag the Button into the open space in the expression. 7a5440d1fafc8a0515ade7900cb1ba78 This will give the text element the value of the Button.
  5. Copy both events to the other buttons.

You won't be able to actually send this list via a real email in Justinmind, but you could create a fake email interface in Justinmind and make it look like you've sent an email that way.

Let me know if you have any questions.

photo
1

That is so helpful, I'm very grateful - and such a prompt reply too!

Another question if you don't mind:

The text that is generated after the button is clicked works great. Is there a way to set a parameter for the text box so that the text doesn't keep going to the end of the page, but reaches the parameter and returns to form a new line?

i.e.

Instead of the text being able to go all the way to the end of the screen ------------------------------------------------------>

It reaches a point where it automatically ⤸

continues in the line below.


Thanks again Danielle,

Isaac

photo
1

I've just had some more thoughts, if you have the patience...

How would I

1. Add an 'undo' button to get rid of the last text added to the screen?

2. How could I alter one of the buttons so that the keypad pops up and the user can add their own word to the list?

Thanks,

Isaac

photo
Leave a Comment
 
Attach a file