CarmeloMilian
Posts: 0
Joined: Sat Apr 06, 2013 4:01 am

Adding sum of fiield to another field.

I am trying to get the contents of one field added to the contents of another field. This is what I am doing on NiceTotal label value change. myMh was established as a setting with value of 0.

var nicefieldtotal = Appery('NiceTotal').text();
myMh = myMh + nicefieldtotal;
Apperyio("NiceTotal").text(myMh);

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Adding sum of fiield to another field.

Hello Carmelo,

Please specify, NiceTotal and myMh are labels or inputs?

CarmeloMilian
Posts: 0
Joined: Sat Apr 06, 2013 4:01 am

Adding sum of fiield to another field.

NiceTotalnis a label, myMh is a setting with value if 0

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Adding sum of fiield to another field.

Carmelo,

Could you please specify
[quote:]myMh is a setting with value if 0[/quote]
what setting?

CarmeloMilian
Posts: 0
Joined: Sat Apr 06, 2013 4:01 am

Adding sum of fiield to another field.

I created a new service and chose settings. There I created myMh and gave it a value of 0.

here is my app.

http://appery.io/app/mobile-frame?src...

Click login, no credentials. Then "My hashlets"

The label that says "Total: 0 MH" is totalMhlbl, it must contain the addition of all input fields in the form. I am trying to start with the one that is named NiceTotal. Its right under Nicehashlet.

This was my attempt

var nicefieldtotal = Appery('NiceTotal').text();
myMh = myMh + nicefieldtotal;
Apperyio("NiceTotal").text(myMh);

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Adding sum of fiield to another field.

Hi Carmelo,

Here is code for you:

pre

var niceTotal = parseInt(Apperyio("NiceTotal").val());
Apperyio("totalMhlbl").text("Total: " + niceTotal + " MH");

/pre

Also you can add to this code some your logic.

Regards.

Return to “Issues”