473,320 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Menu control in javascript

Ji, my problem is simple. I would like to set dynamically the pressed item
of a menu of a form in javascript. First, how to get the value of the item
that has been selected with the mouse. Then how to set it in javascript. I
don't know the object name. I do that like form.myfield.value = xxxx with an
input text, but it it doesnot work for menu !
Thanks for the help

Yves


Jul 20 '05 #1
1 3426
@SM
Yves PEYSSON a ecrit :
Ji, my problem is simple. I would like to set dynamically the pressed item
of a menu of a form in javascript. First, how to get the value of the item
that has been selected with the mouse. Then how to set it in javascript. I
don't know the object name. I do that like form.myfield.value = xxxx with an
input text, but it it doesnot work for menu !


Example :
<form action="" method="get">
<select onchange= if(this.options.selectedIndex==0)
alert('Do an other choice');
else
this.form.action=this.options[this.options.selectedIndex].value;">
<option selected>Choisir une ville - Select a Town
<option value="Paris.htm">Paris
<option value="London.htm">Londres - London
<option value="Tokio.htm">Tokio
</select>
<input type=submit value="GO !">
</form>

others possibilities :

this.form.myTextField.value=this.options[this.options.selectedIndex].value;
alert('Destination = '+this.options[this.options.selectedIndex].value);
self.location=this.options[this.options.selectedIndex].value;

and so on ...

--
************************************************** ************
Stéphane MORIAUX : mailto:st*********************@wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephane.moriaux/internet/
************************************************** ************
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Gleeman | last post by:
Dear Sir/Madam I'm an old dog of VB 6.0. I've mastered the new tricks of .Net Form-based programming rather OK. I now need to focus on web development. My Web pages need not be as glamerous as...
0
by: Phl | last post by:
hi, does any know why my javascript dropdownlist in my user control will only appear if I have my code as follows: // create an instance of the user control Control UCAdminDDMenu =...
1
by: CW | last post by:
I have been using (vertical) data list to simulate menus on left pane of pages (I don't use drop-down and pull-down menus because javascript must be enabled). However, the problem with data list is...
0
by: Sydem | last post by:
I have a classic ASP site that I'm converting to ASP.NET 2.0 using VS 2005 Beta 2 with the VB.NET language. In my classic ASP web app I use a custom Javascript that creates a menu "control". In...
9
by: Jay | last post by:
I have an asp menu control with menu items navigateUrl set to come back to the same aspx page but with different values in a url token. this works, but it is causing all my asp controls to loose...
3
by: John | last post by:
Hi there, I was reading an article (http://avenuea-razorfish.com/articles/TheAll-MenuNavigation_Turbek.pdf) on 'all-menu navigation' and I'd like to try and implement this in my site. Can...
5
by: Victor | last post by:
Hi Guys. I am currently having a problem with my menu control. The requirement for menu is. All root menuitems will be displayed as images. The image for each root menuitem will be different. All...
0
by: BooGhost | last post by:
Some background: 1. I've got a master page with an asp:Menu using an XML sitemap. 2. A page that uses the master page has an object tag (instancing an activex control) 3. This activex control...
3
by: =?Utf-8?B?VG9tIFc=?= | last post by:
When I mouse over a Menu Control based navigation area the drop-down selection list appears instantaneously. Is there a way to make it less sensitive, so that it delays (even a fraction of a second...
9
by: Anic297 | last post by:
Hello, I'm a newbie in php. I would like to show a popup menu on my website and update the page when the user has changed its selection. I have looked over the Internet but haven't found what I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.