Page 1 of 1

Having trouble executing a very simple block of javascript upon value change of label.

Posted: Tue Jul 23, 2013 9:56 pm
by Michael Iglesias

I don't know why my javascript block is not running upon value change of a label.

I pretty much want to split a string based on "--" and insert both parts of the string in different labels.


Having trouble executing a very simple block of javascript upon value change of label.

Posted: Tue Jul 23, 2013 10:22 pm
by Igor

Hello,

Could you please check if you have any errors in console?


Having trouble executing a very simple block of javascript upon value change of label.

Posted: Tue Jul 23, 2013 10:33 pm
by Michael Iglesias

Hello,

I'm not getting errors inside the console. I've pasted the lines of code below

var s = Appery("qrcodeDump").val();

var x = s.split("--");

Appery("hidden_reward_token").val(x[0]);
Appery("hidden_user_code").val(x[1]);


Having trouble executing a very simple block of javascript upon value change of label.

Posted: Tue Jul 23, 2013 11:38 pm
by Igor

It can be that you invoke another actions before this code, and one of this actions is falling. Please try to invoke only this code on button click action.


Having trouble executing a very simple block of javascript upon value change of label.

Posted: Wed Jul 24, 2013 5:40 pm
by Michael Iglesias

So I think I'm over complicating things. I am using the bar code scanner to read a users qr code which is in the following format

UserID-UNIQUE Reward ID
1111--Eraksdjf1231kdfL!kajdkflaks

All I need to do is split this string by "--" and invoke an api service which I have already created and formatted in appery.

How do I split this string and set their values to local storage variables once the barcode scanner has scanned the qr code?

Thanks in advance for your help :)


Having trouble executing a very simple block of javascript upon value change of label.

Posted: Wed Jul 24, 2013 6:38 pm
by Maryna Brodina