Page 1 of 1

toggle event

Posted: Mon Jan 06, 2014 2:48 pm
by Michael4771079

Hi,
I have 2 questions
1.
I have a toggle giving the user the option to pay by cash or card,
I would like the app to navigate to the stripe payment page when value "card" is selected,
I tried it on valuechange but it didnt work

Image

2.
on stripe payment page there is a component called "amountInput"
I have a variable called "totalprice"
on page load I have this code to load the variable to the component

var totalprice = parseFloat(localStorage.getItem("totalprice")).toFixed(2);
Appery("amountInput").text(totalprice);

I have tried on page load and page show, but I am not getting the variable to populate the component, I also tried on complete and on success of the StripePayment_ChargeService but no luck


toggle event

Posted: Mon Jan 06, 2014 3:34 pm
by Maryna Brodina

Hello! Could you post screenshots of what you do? Also please check components and loclStorage names (they're case sensitive).


toggle event

Posted: Mon Jan 06, 2014 4:21 pm
by Michael4771079

Hi Maryna,
I deleted and readded the toggle event and that now works,

as regards the totalprice variable
if I add an event on screen load , set property, the variable populates the component, for eg. if the amount is 10.50, it will load 10.5.

so I used the code
var totalprice = parseFloat(localStorage.getItem("totalprice")).toFixed(2);
Appery("amountInput").text(totalprice);

on screen load, it doesnt work, the variable name is correct as is the component name.
I also tried page show, no luck there either


toggle event

Posted: Mon Jan 06, 2014 4:21 pm
by Michael4771079

toggle event

Posted: Mon Jan 06, 2014 8:52 pm
by Maryna Brodina

Could you clarify amountInput is Input or Label?


toggle event

Posted: Mon Jan 06, 2014 8:58 pm
by Michael4771079

its an input Maryna


toggle event

Posted: Mon Jan 06, 2014 9:16 pm
by Maryna Brodina

Use preAppery("amountInput").val(totalprice);/pre


toggle event

Posted: Mon Jan 06, 2014 9:33 pm
by Michael4771079

Cheers Maryna,
I understand now, all working

thx as always