/    Sign up×
Community /Pin to ProfileBookmark

Trying to add Options to a select

Please see my newer post.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@agent_x91Oct 08.2004 — this thread is a complete waste of space... don't spam.
Copy linkTweet thisAlerts:
@jacen6678authorOct 08.2004 — I'm not spamming... I:

1) made this post

2) decided that i wanted to change the title

3) found that title changes dont seem to work

4) made a new post

5) tried to delete this post

6) found out that that feature is also not working

So, I am terribly sorry if I made an unnecessary post. I am glad that your response was oh so amazingly informative. "Don't spam"... gee thanks... I really did not know that. I hope you are now aware that I tried and was not allowed to clean up my extra postings.

Thank you for your time and insightful contributions.
Copy linkTweet thisAlerts:
@Warren86Oct 09.2004 — <HTML>

<Head>

<Script Language=JavaScript>

function insertOption(isList,isValue,isText){

isData = new Option(isText,isValue);
isList.add(isData,isList.options.length);
}

function removeOption(isList,removeItem){

isList.selectedIndex = removeItem;
isList.remove(isList.selectedIndex);
isList.selectedIndex = 0;
}

function getSelection(isList){

isValue = isList.options[isList.selectedIndex].value;
alert(isValue)
}


</Script>

</Head>

<Body>

<br><br>

<center>

<select name='List1' onChange="getSelection(this)">

<option value='null' selected> Make a selection </option>

<option value='1st'> First </option>

<option value='2nd'> Second </option>

</select>

<input type=button value='Insert New Option' onClick="insertOption(List1,'3rd','Third')">

<input type=button value='Remove Last Option' onClick="removeOption(List1,3)">

</center>

</Body>

</HTML>
Copy linkTweet thisAlerts:
@agent_x91Oct 09.2004 — [B]Thank you for your time and insightful contributions.[/B][/QUOTE]

np, that's what I'm here for.
×

Success!

Help @jacen6678 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 6.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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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