Page 1 of 1

Having a problem with stored variables

Posted: Thu Jan 09, 2014 9:20 am
by Deon

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?


Having a problem with stored variables

Posted: Thu Jan 09, 2014 10:02 am
by Kateryna Grynko

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


Having a problem with stored variables

Posted: Thu Jan 09, 2014 10:41 am
by Deon

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


Having a problem with stored variables

Posted: Thu Jan 09, 2014 10:59 am
by Deon

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????


Having a problem with stored variables

Posted: Thu Jan 09, 2014 11:14 am
by Kateryna Grynko

Deon,

What is your label name? L_Expires or expdate?


Having a problem with stored variables

Posted: Thu Jan 09, 2014 11:45 am
by Deon

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.


Having a problem with stored variables

Posted: Thu Jan 09, 2014 11:49 am
by Deon

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


Having a problem with stored variables

Posted: Thu Jan 09, 2014 12:22 pm
by Deon

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


Having a problem with stored variables

Posted: Thu Jan 09, 2014 3:12 pm
by Maryna Brodina

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


Having a problem with stored variables

Posted: Thu Jan 09, 2014 4:26 pm
by Deon

Hi

Perfect, thank you!