Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

toggle event

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

toggle event

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

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

toggle event

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

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

toggle event

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

toggle event

Could you clarify amountInput is Input or Label?

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

toggle event

its an input Maryna

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

toggle event

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

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

toggle event

Cheers Maryna,
I understand now, all working

thx as always

Return to “Issues”