Toggle state of button with drag and drop

Hi all,

I'm trying create a simple "fill in the blank" sentence. So I have 4 texts (textbox) and 4 lines (invisible square) in the sentence. There is also a "submit" button, initially disable.

I want the state of the button to change to normal when any of the text is dragged onto any line. That was not a problem.

But then I want to change the state of the button back to disable when none of the text is any line, it seems impossible.

I have tried variables, and state triggers, and drag & drop. Looks like I'm missing something here, can anyone help me out?

Attached is the actual file I am working on just to test different approaches. Sorry if it is a little bit messy. 

4 Replies
David Tait

Hi Duke,

On first glance it looks as though the issue is occurring because the triggers are asking that all of A, B, C and D are visited before the submit button switches back to a disabled state.

Also, you need to add the trigger to shape A that makes the state visited when clicked (like you have for the other letters).

Once you've done this, drag all of the letters on to the boxes, then back off again and you should see the submit button disable.

An alternative might be to add a reset button that reloads the slide, coupled with resetting the slide to its initial state when revisiting.

Hope that helps point you in the right direction.

Duke Intraprasert

Hi David,

Thanks a lot for the help. I will try it out and see if there is any different.

I have actually tried many different approaches, and I nitially used the same approach on all  A, B, C, D but later tried different one on just A. That’s why they are not the same.

The problem is not state of the button but it is because A, B, C, D don’t change to the state they way they should.... all the time.

Try “D” for example:

“D” will change its state to green color when it is dropped onto the box. This is easy.  I also want to change to red when it is dragged out of the box. So i set the trigger so that when I click on “D” it is turned to red. So this is how it works:

1. When “D” is clicked, dragged and dropped onto the box ==> Green

2. When “D” is clicked, dragged and dropped anywhere outside the box ==> Red (also returned to its original position)

This works .... but not every time!?!? This is the problem.

David Tait

It seems that the none of the letters get a visited state when you've dragged another letter on top of it to force it to return to the starting point.

I've tried a few different ways that I think should have worked but none of them have. I'll keep thinking about it and let you know if I come up with anything.

Duke Intraprasert

Hi David,

Thank you for the response, I'm also working on it. Will update if there is a way.

The whole point is to show people they can submit the answer once any or all of the letters, or words in the real exercise, are placed in the black space to form a proper structured sentence. And the show them that they cannot submit if nothing is put in blank space.

Note that the Green and Red coloring are just to identify that they states have already changed. In reality, they will look exactly the same.

Basically toggling the "submit" button between Normal and Disable states

Theoretically, this is a very simple concept, but it seems impossible to achieve.  I really feel that I'm missing something here.