/    Sign up×
Community /Pin to ProfileBookmark

deleting a Menu Item

[FONT=times new roman][COLOR=purple]
hi every body..

I was trying to make transaction between two select menus, and i did Finalyyyyyyyy.. BUT .. one last problem still … I want to delete the transfered item from the regional menu … but the way i followed gives me “Error on Page()” shown in the status bar of the browser ..

here’s the entire code:
[/FONT][/COLOR]

[CODE]
<script type=”text/javascript”>
<!–
function formAction()
{
var x=document.getElementById(“mySelect”)
x.multiple=true
}

function addOption(from,to)
{
var sfrom = document.getElementById(from);
var opt = sfrom.options[sfrom.selectedIndex].value;
var d = sfrom.selectedIndex;
var tolen = sfrom.options.length;
var i = d;
for ( ; i < tolen ; i++)
{
sfrom.options[i].value = sfrom.options[i+1].value;
sfrom.options[i].id = sfrom.options[i+1].id;

}
sfrom.options.length = sfrom.options.length -1;

var newOption = new Option(opt,opt);

var sto = document.getElementById(to);
var s2len = sto.options.length;
sto.options.length = sto.options.length +1;

sto.options[s2len] = newOption;

}
–>
</script>
[/CODE]

[FONT=times new roman][COLOR=purple]

any idea will be highly appreciated..

rEgards,
dEllo.[/FONT][/COLOR]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Warren86Jan 26.2005 — function removeOption(isList,removeItem){

isList.selectedIndex = removeItem;

isList.remove(isList.selectedIndex);

isList.selectedIndex = 0;

}
Copy linkTweet thisAlerts:
@delloauthorJan 29.2005 — [COLOR=royalblue]

thank u so much Warren86 ..

I'de like to ask if i can make it possible for selecting more than one item... i know how to make the user able to select more than one item, but i'm not sure if i can send the selected items to the function [B]addOption[/B] .. and delete them using the funtion [B]remoreOption[/B] ..



Any idea?[/COLOR]
×

Success!

Help @dello 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.18,
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,
)...