Michael Iglesias
Posts: 0
Joined: Tue Jul 23, 2013 8:51 pm

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

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.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

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

Hello,

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

Michael Iglesias
Posts: 0
Joined: Tue Jul 23, 2013 8:51 pm

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

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]);

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

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

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.

Michael Iglesias
Posts: 0
Joined: Tue Jul 23, 2013 8:51 pm

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

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 :)

Return to “Issues”