Disable A Dropdown List Based On Selection In Another Dropdown List?

Apr 20, 2011

I have two dropdown lists with the second one being dependent on the selection in the first.

Options in list 1: 1,3 or 4

List two should be enabled when 3 or 4 is selected in list 1.

So far so good, managed to get it to work with only one set of lists, but I actually have 18 of those sets in this form:

<select name="fw[$i]" id="fw[$i]">
<option value="1">FWH</option>
<option value="3">links</option>
<option value="4">rechts</option>

[Code]....

I'm not that adept in javascript programming, more like a trial and error guy, how has hit the wall with this problem.

View 20 Replies


ADVERTISEMENT

Update A Dropdown List Based On The Selection Of A Previous List

Aug 16, 2010

i am writing a script that will update a dropdown list based on the selection of a previous list. the script is run by a PHP script, so instead of posting the PHP, i will post an example client-side script. the hierachy is: category, sub category, brand (but sometimes there exists no sub category and the PHP script queries and adds brands instead) everything works correctly, except for one major issue: you can not change the selection of the third (brand) box this could be an easy fix for some coders, but i am not experienced in javascript and could really use some help. here is an example script, sorry it is so long

[Code]...

View 4 Replies View Related

Auto-Populate Text Field Based On DropDown List Selection

Dec 3, 2009

I have set up my website quite some time ago that has served its purpose very well, however I will now be adding an order form functionality. So far, by reading books and traversing forums, I have been able to develop a page where the user
1.Enters data into the required fields, that is then submitted to a MYSQL database via PHP,
2.Can retrieve orders that are stored in the database,
3.Delete orders that are stored in the database.

I have wamp installed on my computer as the webserver. I have also incorporated two drop down lists that both retrieve their values from tables within the database. The first drop down list retrieves the Australian States that I have stored in a table, and once the submit button is pressed, it stores the State that is selected to a separate table. This drop down list functions as it should. An extract from "From Place an order.php"

<?php
$dbcnx = @mysql_connect('localhost', 'root', 'tingling');
if (!$dbcnx) {
exit('<p>Unable to connect to the ' .
'database server at this time.</p>');
} .....

The second drop down list retrieves product names from a table that contains products and their prices. What I would like to happen, is that when the product is selected from this drop down list, a text box is automatically filled with its corresponding price. I had this drop down list working as per the "States" drop down list, but could not get it to auto populate the text field. I got some assistance from a friend and was able to get the text box to auto populate with its corresponding price, however when the page was submitted to the database, the "id" number of the product name from the drop down list was stored, and not the product name.

<select name="productSelection" onchange = "getProductDetails(this)">
<option selected value="1product">Select Product</option>
<?php
$products1 = @mysql_query('SELECT * FROM products');
if (!$products1) {
exit('<p>Unable to obtain author list from the database.</p>'); .....

View 9 Replies View Related

PHP Drop Down List Selection Populates Second Dropdown List Or Text Box?

Jul 13, 2011

I have been struggling on a bit of code for a while now. I need to populate a second drop down list (Region) based upon the selection of the first (County).I have found a piece of code that works on its own and have adapted to suit my needs - see below. However, when I drop it into my main page the javascript is not working. It's because of the formObject but I just don't know enough to resolve this! Furthermore, I need the textboxes the user has already completed in the form to retain their value once the javascript kicks in as the completed form will submit to a database.This piece of code is working well . . . .

<?php

$link = mysql_connect('myhost', 'myusername', 'mypassword') or die('Could not connect: ' . mysql_error());
mysql_select_db('mydatabase') or die('Could not select database');[code]......

View 2 Replies View Related

JQuery :: Populate A Dynamic Dropdown List Based On Another Dynamic Drop Down Selection?

Jun 29, 2010

how to populate a dropdown based on Another dropdown selection. This all should be a dynamic. Eg: I have two text boxes one is TechID and other is JOB ID. When I start typing Tech ID it suggests me the list of IDs which start with the input string i have put in Tech textbox. When i select the Tech ID the jobs associated to that Tech ID should be displayed in JOB ID text box as a dropdown list.

View 1 Replies View Related

Disable/Enable Checkboxes Based On Dropdown Selection?

Jan 14, 2011

I have searched and found lots on enabling/disabling form inputs, but nothing that matches my needs.

I have a form with a dropdown with values 0-4. If value 0 is selected I want the checkboxes to be disabled. If value 1-4 is selected I want the checkboxes to be enabled.

Code:
<html>
<head><title>Disable with Dropdown Test</title>
<script>
function num_check(sel,cb) {

[Code]....

View 11 Replies View Related

Dropdown List Selection

Feb 28, 2004

Here is what I'm trying to accomplish: I've got a dropdown list that is populated via a php script. Whenever the user selects a value from the list, they have to click on the 'submit' button in order to retrieve the values. I don't want this .... I don't want them to click on the button, rather, retrieve the values from the DB immediately upon selection of a list item. Its like ... I select a value from the dropdown list and it automatically uses its value to retrieve relevant details from the DB, no need to click on any button or anything. How do I do this with js ? Can I accomplish the same with php as well....

View 3 Replies View Related

Disable Text Field Based On Dropdown Menu Selection

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

Jump To Url From Dropdown List Selection

Jan 11, 2007

I am creating a dropdown menu for my site because I have run out of space for a nav bar, what I would love to do is create a dropdown list that when an option is selected will jump to a specific URL.

View 2 Replies View Related

DropDown List Popup Depending On Selection?

Oct 27, 2010

Here is my dropdown menu:
<select name="peeps">
<option value="Frank Tompson">Frank Tompson</option>
<option value="Henry Wilson">Henry Wilson</option>
<option value="Bill Kent">Bill Kent</option>
<option value="Jessi McDonald"> Jessi McDonald</option>
<option value="John Hays">John Hays</option>
How can I make it so if I click on John Hays a JavaScript pop up will say Hello John Hays, and if I click on Bill Kent a popup will say hello Bill Kent and if I click on any other name nothing happens?

View 3 Replies View Related

AJAX :: Populate An ASP List Box Based On Selection Of A Previous List Box?

Mar 7, 2011

I have 3 ASP list boxes. I would like to populate the second list box based on the selection in the first list box and based on the selection in the second list box, populate the third. I would like to do this using AJAX. How can I do it? Can someone please give me the code snippet as I am a complete noob when it comes to AJAX and I kinda am running outta time to finish implementing it. Additionally, should I use ASP boxes or HTML <select> tag?

View 4 Replies View Related

Jukebox - Replay List And - Create Non Dropdown List ?

Sep 1, 2010

I am trying to construct a Jukebox for my website. I have spent considerable time all over the WEB and at this forum which addressed the issue in a 50 page thread. Please see: [url]

I got a lot of ideas from this thread but still cannot figure a way to do the following within the Jukebox. These are my main two questions for everything below:

1.How can I have the Jukebox cycle through all tunes and then start over from the beginning?

2.How can I allow the user to select a tune from a list but not a drop down list, have the Jukebox start from the users selection and then play all songs to the end. Then as in #1, start over from the beginning?

Per this thread I came away with basically two ways to assemble the jukebox. One uses links in a drop down list which the user can choose from. The other is to use an .m3u playlist. The user can only select a playlist from the drop down.

Below, I have included the code for each Jukebox. To see the Jukeboxes in action please go to my website where I have posted some test pages exhibiting the jukeboxes that I am referring to.

The following is the Jukebox which utilizes an .m3u playlist. If I end up using this idea I would like the tunes in the .m3u playlist to be displayed and allow the user to be able to choose a tune in the list. Then have the list play to the end of all tunes in the list. Then start over from the beginning of the list. After this code is the .m3u playlist.

Go to url removed and click on the link that says:

Jukebox utilizing an .m3u playlist:

Here is the .m3u playlist for the above code:

The following code is for the Jukebox that has a list of links in a dropdown list. If I go with this idea, I would like for the list not to be a dropdown list but just a list of tunes. The user should be able to click on any tune in the list and the player should start from that point, play all the remaining tunes in the list and then start from the beginning.

Go to url removed and click on the link that says:

Another idea I found on the WEB also uses an .m3u playlist. The good thing about it is that it lists all the tunes in the playlist which the user can then select from. This jukebox calls up an entire Windows Media Player. If I was to use this idea I would like to be able to disable the left side of the player where the user has options such as burning to CD, Media Guide, Radio Tuner etc¦

Go to url removed and click on the link that says:

View 1 Replies View Related

JQuery :: (.) Period In Value Field - Show/hide A Div Based Based On The Selection Made Via A Dropdown

Apr 9, 2010

Im using a jQuery script to show/hide a div based based on the selection made via a dropdown.

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>

The problem im having is that the value used in the dropdown lists are price values eg 10.00

Consequently jQuery seems to interprit these as css notations, meaning the code doesnt work.

View 4 Replies View Related

Div To Appear Based On Dropdown Selection?

Aug 2, 2011

Code:
<div id="1">
<asp:DropDownList ID="DD1" runat="server">
<asp:ListItem>option1</asp:ListItem>
<asp:ListItem>option2</asp:ListItem>

[Code]....

I want the div with the id of "option2show" to be hidden unless the user has selected option 2 in the dropdown box.

If the user has selected option 1 then nothing will happen, however iff option 2 has been selected then the option2 div will appeaar. I would like this to happen before any submit buttons are press, so i guess onblur of the dropdown box.

View 3 Replies View Related

Hiding Dropdown Menus Based On Selection

Sep 8, 2010

i am building a website form which I would like the user to select a product of interest. Some products are three tiered and some are two tiered.

1. Example of three tier (3 dropdowns required only):Scooters (dropdown 1)Three Wheel Scooters (dropdown 2)
Delux 503S Bird Scooter (dropdown 3)

2. Example of two tier (2 dropdowns required only):Standing Bikes (dropdown 1)Children 300 Series (dropdown 2)

If the user wants to submit their interest for one of the products, I need to have at most 3 dropdown menus. So in Example 1, I would have 3 dropdowns in my form. Dropdown 1: Scooters Dropdown 2: Three Wheel Scooters Dropdown 3: Delux 503S Bird Scooter.In Example 2, I would only need to use the first 2 dropdown menus. (Obviously the first dropdown would contain 'Scooters' and 'Standing Bikes' in the menu list)I would like to alter the code so that the second and third dropdowns are hidden until a selection from the first drop down is made. Once for example, 'Standing Bikes' is selected from the first dropdown menu, the second dropdown menu appears and the third remains hidden due to the fact that it is not required. If I selected Scooters from the first dropdown menu, the second dropdown would appear listing all items associated with this and at this point the third dropdown menu is hidden. If i select 'Three Wheel Scooter' from the second dropdown the third dropdown menu now appears listing all Three wheel Scooters such as 'Delux 503S Bird Scooter'.

View 2 Replies View Related

Appear / Disappear Text Box Based On Selection From A Dropdown

Mar 25, 2011

I have a page on which I have 2 dropdowns. Both are similar. I have a piece of code that whill make a textbox appear if we select "list Box" as the option in the drop down. But for some reason, the first dropdown works fine, but for the second dropdown, the textbox is always there on page load. The code that I am presenting can be copied as a HTML page and you will know what I am referring to.

<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

Textarea Visibility Based On Dropdown Selection?

Feb 1, 2009

I have a form which has a dropdown menu on it. The last option on the menu "other". When "other is clicked, I would like a textarea to become visible, so that the user can enter the new information. Does anyone know how I might do this?

Here is the html for the form:

HTML Code:
Union: <select name="union" id="union">
<option value="choose">Choose One</option>
<option value="ibew">International Brotherhood of Electrical Workers</option>
<option value="ibt">International Brotherhood of Teamsters</option>

[Code]....

View 6 Replies View Related

Change Form Based On Dropdown Selection

Sep 23, 2011

I have a dropdown box with 2 selections(True/False default False) .If false I want to show under it a form like so.

input text
input check
input text

View 9 Replies View Related

Activate/Deactivate Fields Based On A Dropdown Selection?

Apr 29, 2010

On a registration form I have 4 fields that are all dropdown select fields. NAME, CLASS-1, CLASS-2, CODE

1) I would like to activate the CLASS-1, CLASS-2, CODE fields only if the NAME IS Selected from the dropdown.

2) Also would like to make the CLASS-1, CLASS-2 as required fields if the NAME is selected from the dropdown.

How can I achieve this? Can I use some kind of a server event to activate / deactivate the fields on the form?

View 12 Replies View Related

Appear / Disappear Text Box Based On Selection Of Dropdown Menu

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

Populate Checkboxes Based On The Dropdown Menu Selection?

Jun 29, 2011

how to populate checkboxes based on the dropdown menu selection

View 2 Replies View Related

JQuery :: Dropdown Menu Selection Dynamically Alters Selects Of Other Dropdown Menus On Same Page?

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

JQuery :: Create Datatable Based On Dropdown Selection Ajax

Jun 7, 2011

I have a page which has a dropdown box.On selection a value is sent to a php script (Ajax), based on the value a html table is created and sent back to the responseText.The table is outputted to the html page, I want the table to have sortable columns, so I have used jquery datatables for this, but it is not working.I have cut and pasted the exact table into the html and ran the page, and then sorting works.

View 1 Replies View Related

Form Effects: Number Of Options Based On Dropdown Selection?

Jul 22, 2009

I have been searching for hours and have not found what I am looking for. BUT, I have seen it before when I was NOT looking for it. haha!

Anyway, I am creating a form. And the form has an element that asks for "How Many Children?" followed by a dropdown from 1 to 6.

Well I would like to display another set of elements from 1 time to 6 times, based on their selection.

Name: ___ Age: ____ Sex:____

That will be displayed as many times as the user selects.

View 4 Replies View Related

Hiding / Disabling Submit Button Based On Dropdown Selection

Nov 9, 2010

How can I hide/disable the submit button if the name Todd is selected?

View 7 Replies View Related

Capturing Radio-buttons Based Dropdown Selection Into A Variable

Jul 16, 2011

Codes for Dropdown menu based on radio buttons selection needed!

I need urgent help with this:

I need codes for a dropdown menu that is altered by radio buttons.

I want to insert the value selected from the dropdown menu into a table.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved