/    Sign up×
Community /Pin to ProfileBookmark

scripting variables question…

in short, I need to process parts that are defined as:

date_0 where date 0 = 2008-02-20
date_1 where date 1 = 2008-02-21
date_2 where date 2 = 2008-02-22

in the html codeset.

I would rather utilize an array, but circumstances do not allow it for this application.
.
the javascript is set up as follows:

for(i=0; i<date_field.value;i++)
{
var date_begin = “entries[‘entry_date_enter_”;
var date_middle = i;
var date_end = “‘]”;
var date_variable = date_begin+date_middle+date_end;

alert(entries[‘entry_date_enter_0’].value);
alert(date_variable);
alert(date_variable.value);
}

the first alert shows: 2008-02-20
the second alert shows : entries[‘entry_date_enter_0’]
the third alert shows: undefined

what do I need to change to get the third alert to show 2008-02-20.

Can anyone show me what I am missing???

TIA

Joe

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @wigglebrother spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...