Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Having a problem with stored variables

Hi

I seem to be having an erratic issue with stored variables.

This code does not insert the value of the text label into the stored variable

Stored variable = ExpiryDate
Text Label Value = L_Expires

I have tried the following...

var expiryD;
expiryD = Appery("L_Expires").text();
localStorage.setItem('ExpiryDate', expiryD);

As there seems to be no consistency with syntax, I have also tried

var expiryD;
expiryD = Appery('L_Expires').text();
localStorage.setItem('ExpiryDate', expiryD);

What is wrong with this code. I think I am being blind?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Having a problem with stored variables

Hi Deon,

This code will display Label value and localStorage variable value in an alert:
prevar expiryD = Appery('L_Expires').text();
alert(expiryD);
localStorage.setItem('ExpiryDate', expiryD);
alert(localStorage.getItem("ExpiryDate"));/pre

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Having a problem with stored variables

Alert is blank. appery.io says and nothing else.

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Having a problem with stored variables

This is bizarre

I deleted the label and created a new label expdate.

I changed var expiryD = Appery('L_Expires').text(); to
var expiryD = Appery('expdate').text();

It works!

This does not make sense at all. I double checked/tripple check syntax/spelling????

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Having a problem with stored variables

Deon,

What is your label name? L_Expires or expdate?

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Having a problem with stored variables

It was L_Expires. I then deleted the label and created a new one called expdate and all of a sudden it work. I am having strange things happening.

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Having a problem with stored variables

Can you please tell me the syntax to get the URL from a image field.

I have tried....

Appery('mobileimage_14').val(); - Does not work
Tiggzi.getImagePath('image_name') Returns the file path an not the URL

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Having a problem with stored variables

It works fine for one record but not for another. It is just not making sense.

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

Having a problem with stored variables

Hello! preAppery('mobileimage_14').attr("src")/pre

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Having a problem with stored variables

Hi

Perfect, thank you!

Return to “Issues”