David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

if command not working

code
var x= Apperyio('xin').val();
var y= Apperyio('yin').val();
var xx= Apperyio('xx').val();
var xxx= Apperyio('xxx').val();
var score= Apperyio('score').val();
var yy= Apperyio('yy').val();
var yyy= Apperyio('yyy').val();
alert(x+"-"+y+"-"+xx+"-"+yy+"-"+xxx+"-"+yyy);
if (x<xx) {
alert("x low"); }
else if (x>xxx) {
alert("x high"); }
else if (y<yy) {
alert("y low"); }
else if (y>yyy) {
alert("y high"); }
else {
++score;

Code: Select all

     alert("score "+score); } 

/code

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

if command not working

Thank you, thats better. is there any update why its not working in my app?

ive also tried
code
if ( var < x || var > y )
/code
format and it still doesnt work?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

if command not working

Please describe case in which it doesn't works correctly.

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

if command not working

Hi,

i have the javascript running on a button command but it doesnt work. it is actually part of a another more complex app that i have built. i couldnt understand why it wasnt working so i have built this app as a debug and even with everything strip back im having the same issue. the app has been shared with apperyio support, its called hit.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

if command not working

David,

If you mean in this case:

Image

Values in the input fields are strings, you need to convert values to integer and then perform mathematical comparisons.

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

if command not working

Thank you, how do I convert them?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

if command not working

You can use codeparseInt();/code more information here.

David wyatt
Posts: 0
Joined: Mon Sep 15, 2014 7:12 pm

if command not working

Brilliant, thank you

Return to “Issues”