/    Sign up×
Community /Pin to ProfileBookmark

Writing options in select

I have 8 pages that are very similar. The only difference is the select options with different group of names on each page. I am using a global script.

Is there a way to have a central point with array of names that would write or function in the select option depending on the page.

Thanks again.

Example below

array_a = 1,2,3,4,5,6

array_b = 101,102,103,104,105,106

array_c = 201,202,203,204,205,206

Page 1
<select id=page1>
write array_a
</select >
Page 2
<select id=page2>
write array_d
</select>
Page 3
<select id=page3>
write array_c
</select>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERMay 24.2011 — When are the different pages to be loaded?

One time when page is first rendered (displayed)

OR will they change after the page has been rendered?

?

If the second method, you might be better to display all arrays into different <div> sections

and show/hide contents depending upon operators selection needs.
×

Success!

Help @DJScript 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.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...