justinmind-logo
 
Upvote 2

Making Calculations Automatically

Answered Victor Conesa 9 years ago

I want to create an event where a measurement is entered into a input field and the measurement is then automatically subtracted from another existing field and populates a third field. Sounds pretty basic, but can't figure it out. Thanks. d917a025b82bcbc7d728869ba217a4f6

Best Answer
photo

Check out this tutorial to learn how to create calculations in Justinmind.

Replies (4)
photo
1

Hello David,


In this case, you will need to have a trigger to determine when the editing of the second field has finished. For example, you may do so by specifying an on key up event type to occur after any given key is pressed. Then, you may add an action of set value for the third text box and select calculated to open the expression builder. Once there, you'll need to drag the first text box, a minus function, and then finish with the second text box.


Sincerely,


Luisa

photo
1

Luisa, been there and done that. The problem (I think) is that the first field you see with existing numbers are variables that have been transferred to this screen from a previous screen.


I have tried everything without luck including:


1. Creating a new event and following your instruction above -- field two is triggered by a tab after the data is input to make the calculation and display in field three. Result: a calculation is made with the wrong answer (ex. 2 -1 = 120)


2. Tried to add the above tab trigger calculation as an "add action" to the "Do" part of the variable event. Result: did not work.


3. Added an "interaction" from the"On page load" that populates the variable data display No luck.


If I remove the variable data event in the first field and manually populate the field with numbers it works, so I'm pretty sure it has something to do with the problem. It seems very strange that I get weird results when a calculation is made -- negative numbers like -132. Please help. I won't be able to demo this key part of my in presentation tomorrow at 9 pst, which is bummer.


I am attaching the whacky calculations it's making. 5db65ce8a9a1f7fa0c8e61d6030b166e

photo
1

Hello David,


The calculations you are receiving are indeed bizarre. If you wish, you may send your prototype file to us.


In this way, it will be easier to understand the types of events currently in place and provide a resolution before your timeline.


Regards,


Luisa

photo
1

Check out this tutorial to learn how to create calculations in Justinmind.

Leave a Comment
 
Attach a file