I have created a form variable named customerData like this
{
data: "faraz",
cPage: 1,
tPages: 3,
showData: function() {alert('in show data');},
showPager: function() {alert('in show pager');}
};
Now i am trying to access the cPage from onclick of a button with this code
app.alert(customerData.cPage);
but its giving me undefiend.
How to access the cPage, tPages values?
Views
Replies
Total Likes
Try this way..
customerData.cPage.toString();
Thanks
Srini
Views
Replies
Total Likes
Now nothing happened on click.
Views
Replies
Total Likes
Views
Replies
Total Likes
You have declared the customerData in the click event of button. I want to write the customerData in Form variable (i.e. global) so that i can access it from any event of any field.
Views
Replies
Total Likes
What I see is when the variable is declared at the form level, it is treated as a String variable. But when I declare the variable inside the click event it is treated as an object. The syntax I sent you will work only if it is an object. Bruce has given some explanation in one of the earlier discussions. I will search and send you why this difference in the behaviour.
Thanks
Srini
Views
Replies
Total Likes
I just found that i need to create variables like this
form1.#subform[0].#variables[0].customerData - (JavaScript, client)
var data= "faraz";
var cPage= 1;
var tPages= 3;
var showData= function() {app.alert('in show data');};
var showPager= function() {app.alert('in show pager');};
then i can access from anywhere like this
customerData.showPager();
or
app.alert(customerData.data);
Views
Replies
Total Likes
Here is the old thread where Bruce explained in detail.
http://forums.adobe.com/message/2463978#2463978
Thanks
Srini
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies