Menu Selection
Jun 22, 2004
how i can create the list of menu that when we want to select certain item instead of we must select manually....mayb u all dont understand...ok like this, i want to select item 'cow' in list of cat, dog, cow, deer n etc...so when i press 'c' then the item cat n cow will appear, but i dont want be like that....but i want when i press 'c' the menu list appear as usual then when i press for the 2cd time, i press 'a' only cat will appear in the option list.
View 1 Replies
ADVERTISEMENT
Apr 28, 2010
I have three dropdown menus (side dish, veggie, fruit). Based on the side dish selected (fruit or veggie), I'd like the fruit or veggie menu to appear automatically, while the one not selected stays hidden. Below is the code for the HTML part. I have no idea how to get started with the javascript.
<head>
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<label>sidedish
<select name="sidedish" id="sidedish">
<option value="fruit">fruit</option>
<option value="veggie">veggie</option>
</select>
</label>
<label>veggie
<select name="veggie" id="veggie">
<option value="carrots">carrots</option>
<option value="corn">corn</option>
</select>
</label>
<label>fruit
<select name="fruit" id="fruit">
<option value="banana">banana</option>
<option value="orange">orange</option>
</select>
</label>
</form>
</body>
</html>
View 2 Replies
View Related
Feb 15, 2009
Basically I have a form, with two simple select menus, both identical except for different name values to post:
HTML Code:
<p>Make current?</p>
<select name="is_current">
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
<br />
<p>Put in list?</p>
<select name="in_list">
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
Some PHP code governs whether the "yes" or the "no" option in either menu gets the 'default' "selected="selected" showing, based on database information. For instance, in the first menu, if the page deals with a case where the the first "is_current" value is indeed current, then the PHP code will write the default "selected="selected" for "yes":
HTML Code:
<select name="is_current">
<option value=yes" selected="selected">Yes</option>
<option value=no">No</option>
</select>
If the page deals with a case where the value isn't current, the selected="selected" code will be written for the "no" value instead. The same goes for the second select menu. Now, the logic of my situation requires that, if the user selects "Yes" in the first "is_current" drop-down, then only "Yes" should be available to select in the second "in_list" menu. Anyway, I don't know javascript very well, but I found a function that seemed to be able to do this.
Code:
<script type="text/javascript">
(function () {
function updateLevel() {
var limit = Number(this.value);
// find the next select element
var selects = this.form.getElementsByTagName('select');
var select;
for (var i = 0; i < selects.length; i++) {
if (selects[i] === this && selects[i+1]) {
select = selects[i+1];
break; .....
(Apparently the script has to be put or called just before the </body> tag at the end of the page.) Then the select menus are recast as:
HTML Code:
<p>Make current?</p>
<select name="is_current" id="in_list">
<option value="1">Yes</option>
<option value="2">No</option>
</select>
<br />
<p>Put in list?</p>
<select name="in_list">
<option value="1">Yes</option>
<option value="2">No</option>
</select>
Now this appears to work, up to a point. If the user selects "Yes" for the first "is_current" selection, then only "Yes" becomes available for selection in the second "in_list" menu. A posted value of "1" represents "yes", and a value of "2" represents "no". Except, in Firefox, the javascript somehow overrules the default selected="selected" code. That is, the source code in the browser is correct, but the javascript draws it incorrectly.
For instance, say the database/PHP has drawn selected="selected" for the value "yes" in the second menu. Even though I can see that the source code is OK in the browser, the javascript will make the browser show a "No" selection as the initial default. This happens in Firefox, though not in Safari, and I haven't tested other browsers yet. This may be obvious but I'm not sure of javascript.
View 11 Replies
View Related
Jun 15, 2011
say i have a select menu "select1" with several options available. And a color "color" menu with several options for color. Inside my "select1" option list i have a "variety" option.With this option selected i no longer need the "color" menu at all. I need a javascript or jquery that will make it so that when "variety" is selected it then hides the "color" select menu.
View 1 Replies
View Related
May 1, 2009
I have the following code I picked up which tries to fill in a text field with data depending on a user's menu item selection. I place this code in the header:
Code:
var colors = new Array();
colors["apple"] = "red";
colors["grape"] = "purple";
colors["milk"] = "white";
colors["cheese"] = "yellow";
colors["chicken"] = "white";
colors["beef"] = "red"; .....
var groups = new Array();
groups["apple"] = "fruit";
groups["grape"] = "fruit";
groups["milk"] = "diary";
groups["cheese"] = "diary";
groups["chicken"] = "meat";
groups["beef"] = "meat";
function printColorAndGroup(){
var value = document.getElementByName('food').options[document.getElementByName('food').selectedIndex].value;
document.getElementByName('food_group').value = groups[text];
document.getElementByName('food_color').value = colors[text];
}
I then use the following html in the body:
Code:
Food:
<select name="food" onchange="printColorAndGroup()">
<option>apple</option>
<option>grape</option>
<option>milk</option>
<option>cheese</option>
<option>chicken</option>
<option>beef</option>
</select>
Group:
<input type="text" name="food_group">
Color:
<input type="text" name="food_color">
But when I run this nothing happens...
Here's the page [URL]. None of the code above is colored... looks like I'm using the wrong tags here. Which tags should I use to post this stuff correctly?
View 12 Replies
View Related
Mar 4, 2010
I am creating a website for a friend where the user cant can choose what jobs they want to do while a event. There a are more than 300 people involved so I found a script that worked fine but it used some checkboxes, and I want to use drop down menu (one drop down menu for every day of the event). With the checkboxes it worked fine but when I modify the part to insert the dropdown menu and that on my webpage I choose a job and then I send it and it tells me that I haven't selected anything.
This is the PHP code of the webpage:
<?php include("login.php"); ?>
<html>
<head>
<title>Tickets</title>
<style>
* {
font-size: 11px;
font-family: arial;
}
</style>
<script>
function reserveSeats() {
var selectedList = getSelectedList('Reserve Seats');
if (confirm('Do you want to reserve selected seat/s ' + selectedList + '?')) { .....
View 4 Replies
View Related
Apr 13, 2011
I enter information in a system based on the # of a report that comes in. So if I see a report that says "333" i want to enter specific information for "333" same with "444" and "555" and so on and so forth.So I want to have a drop down menu for 111, 222, 333, 444 etc.Basically what I need is, if I select the report # from the drop down menu, I want it to copy information from a HIDDEN textbox to the clipboard.
View 4 Replies
View Related
Nov 7, 2011
I need a jump menu, that when an item is selected the next jump menu pops up with more selections to be made. Is this possible?
View 8 Replies
View Related
Apr 29, 2009
I have not been able to get this output change when the drop down menu choice changes. I have looked at numerous examples but I can't find one that has this simple output change. What am I missing?
<HTML>
View 3 Replies
View Related
Aug 24, 2010
I am new to JavaScript. I am currently developing a simple CMS in PHP & MySQL. Most of work is already finished, bu now I have to tweak some functionalities in increase user experience. One of it is folding menu (tree menu). I am generating it in PHP and currently I'm using simple JavaScript to expand/collapse submenus (folders). Idea is simple - when an expandable list item (<li>) is clicked (onmouseclick) a simple JS funtion is executed that display a child list (<ul>) and in this way I am building a simple tree menu.
The function is following:
Code:
function showHide(msg_id)
{
var element = document.getElementById(msg_id);
element.style.display = element.style.display=='block' ? 'none' : 'block';
}
The problem is that when I click an list item (that leads to certain article) in a submenu, whole page is reloaded and all previously opened submenus collapse. I would like to have expanded elements that are leading to the last one that I clicked. How can I achieve it? Can you provide me some links to tutorials? Or maybe giva a hint how to tweak my function?
View 1 Replies
View Related
Feb 22, 2011
I am new to javascript stuff but am looking to develop a form which includes 2 drop down menus but I would like to grey out some options in the second one based on the selection in the first. Basically this is a simplification of what I have:
<select name="orientation" id="orientation">
<option value="OR1">South</option>
<option value="OR2">East</option>
<option value="OR3">North</option>
<option value="OR4">West</option>
</select>
<select name="location" id="location">
<option value="L1">Front Left</option>
<option value="L2">Front Right</option>
<option value="L3">Rear Left</option>
<option value="L4">Rear Right</option>
</select>
What I would like is that if south or east are selected for orientation then I can only select front left or front right but if north or west are selected then only rear left or rear right are available.
View 3 Replies
View Related
Jul 23, 2005
I'm trying to figure out how to tackle this problem: I have an XML
table with a cool grid in which users can select a table row. When
they right-click on a cell, they get a modal dialog window with a
selection menu. What I want this thing to do is display the different
values in the row, so that users can make a selection: eventually I
want it to be a filter option > in the selection menu, users can
select the value on which they want the whole table to be filtered.
However, I'm seriously lacking js-skills so I don't know how I should
pass the values from the table row to the selection menu. Code:
View 3 Replies
View Related
Apr 12, 2011
I have a Javascript function that allows the display of a textbox upon selecting an option from a dropdown menu. In my case when a user selects listbox as the option, the text box appears. I want the same thing to happen when another option (checkbox) is selected. when I repeat the JAVAscript code, the first textbox(listbox's textbox) appears irrespective of which option(listbox, checkbox) I select. I want to be able to appear/disappear only the respective textbox. Here is my code.
<html>
<script type="text/javascript" >
function showfield(name){
if(name=='lstbox')document.getElementById('div1').style.display="block";
else document.getElementById('div1').style.display="none";
}
function hidefield() {
[Code]....
View 2 Replies
View Related
Jun 29, 2011
how to populate checkboxes based on the dropdown menu selection
View 2 Replies
View Related
Mar 12, 2010
I don't want to show a table with ALL the contact details on. I want to offer a dropdown menu or similar with the countries inside it, and then dependent on the country selected, the relevant contact information would be displayed in a text box alongside. How can I create this and - equally importantly - integrate it into a WordPress page?
View 3 Replies
View Related
May 13, 2003
I was wondering if anyone can point me to an example where:
You select an option from a drop down list Based on what you select, if writes information to 1 or more text fields.
View 3 Replies
View Related
Aug 31, 2005
Basically i am doing a form which allows the user to input the office branches for this company. The user can input up to a maxi of 10 branches' details like location and tel.
the form details for each branch looks like this
<tr>
<td align="left">Location/font></td>
<td align="left"><input id="location" name="location" size="20"></td>
</tr>
<tr>
<td align="left">Tel/font></td>
<td align="left"><input id="tel" name="tel" size="20"></td>
</tr>
I would want a dropdown menu which allows the user to select 1 to 10 offices and with that the immediate appearance of the number of branches after the user has made the selection.
Another possible way is a link which allows the user to add another branch and keeps adding till a maximum of 10.
View 1 Replies
View Related
Feb 18, 2009
I have a simple form - I want to disable the text field if Choice 2 from the dropdown menu is selected. I have this working with the code below, but for some reason if I go back and select choice 1 after selecting choice 2 the text field remains disabled. I only want it to be disabled if choice 2 is selected.
View 5 Replies
View Related
Nov 26, 2009
I'm pretty bad with Javascript, but I need to hide or show a snippet of text (could be inside a div without problems) based on the selection of a dropdown menu (<select>). If they choose anything with the word "Series" on it, I need to show the snippet. If they choose anything without "Series" on it, then the snippet needs to disappear. I should mention the snippet is part of a form, just a checkbox but that shouldn't be a problem I don't think.
View 24 Replies
View Related
Jul 12, 2010
Just curious if there is a way to control a table cell color based on a menu selection.
I have several colors like Red, Navy, Black, Green, Gold and would like to show a swatch of this selected color beside the menu.
View 4 Replies
View Related
Jul 24, 2010
I have a project where I need a selection of one dropdown menu may affect the select of multiple other dropdown menus on the same page.First, a table is generated, and within each row, it contains a dropdown menu. Assume: Rows A, B, C, etc..., and Dropdown selection: 1, 2, & 3If dropdown in Row A selects 2, then I want the selection of dropdowns in rows B & C to dynamically change to 2.And if in Row C user selects 3, then the selection in dropdowns in rows A & B should dynamically change to 3.
View 1 Replies
View Related
Feb 15, 2011
I have trouble with SuperFish Menu, of course it looks very nice and is good solution, but I am not advanced in CSS language.how to change space between menu and submenu in Navi-bar type menu? Now sobmenu hide part of menu, I have to must space.....
Attachments
superfis.JPG
Size : 11.4 KB
Download : 306
View 1 Replies
View Related
Jun 3, 2009
The problem is that the height of the second level menu results in their being gaps in between each menu item so that as you move your mouse down the second menu items it quickly closes again. scripting novice fix this by telling me which variable I need to change either in the Java script or the CSS files.
View 2 Replies
View Related
Nov 5, 2010
I have a mega menu that when the main menu items is hovered over the mega menu the div is displayed. I want to keep the div from being shown off the right of the browser screen. I have the following that determines the amount a div is off the right of the browser:
Code:
function keepMenuLeft(){
var div_width = $("li.hovering div").width();
[code]....
View 1 Replies
View Related
Oct 6, 2009
I have installed Superfish menu module with Joomla ..Customization work more less fine ...I still have tenious problem like :
- How to have the main menu with the active color, when one of the sub-menu has been actived ?
- How to change the inactive color of the sub-menu without changing the inactive colro of the principal menu ...I did not found any information on the web ..
View 2 Replies
View Related
Aug 27, 2010
I have created a jquery accordion menu for a brilliant CMS called 'Concrete5' and all works lovely BUT I now would like the menu to stay open if a menu item is selected within the drop list.I have manged to create the following.....
var pathname = window.location.pathname;
var selecteda = $(".nav-selected a").attr("href");
// alert (selecteda)
[code]....
..but it doesn't seem to work.I'm not a JQuery GOD like most of you on here but I am trying my hardest The accordion menu I am trying to get this to happen on is Accordion Menu.
View 1 Replies
View Related