Dependent Listboxes

Jun 7, 2005

Suppose that I have a combo box filled with unique numbers handled from beans. And next a listbox including numbers and some names again handled from a beans. Now I want to make the listbox dependent to the combo box. When I select the number within combo box I want the listbox show the names related to this number. I only know that I should use Javascript. onChange event e.g Can anyone ghelp me about how the Javascript function should be?

View 1 Replies



Oct 12, 2004

I'm trying to populate a second listbox from values in a first listbox. I have the following javascript and it works when moving values to the second list box but not backwards Code:

View 2 Replies View Related

Php, Sql, And Dynamically Generated Listboxes?

Jan 19, 2011

I want to dynamically generate list box options using the content of an sql database in real time. More specifically, i have a page with a couple of listboxes, when i click on an option in the first list box, i want the second list box to update with options that reflect the first one, in real time generated by the sql i was wondering if it might be possible for javascript to send some thing to php which php could decode and search the database and return the results of that search. here is how i imagine the process to look in psudeo code:- user clicks on an option (say the 3rd option) in the 1st listbox- javascript catches the event, and sends some data to php indicating the 3rd option from the 1st listbox has been clicked- php tells sql to search for records that correlate with the 3rd option from listbox 1- php sends search result back to javascript- javascript populates the 2nd listbox with search resultsi want to do this with out having to refresh the webpage, security issues aint high, cause this project probably aint gonna go on the web. I got the idea from the dynamic searching on google, so i guess such technology is possible some how.

View 2 Replies View Related

Add The Values Of Latitude And Longitude Into The Listboxes?

Feb 12, 2010

you can see the sample here [URL]

click on the map to add a marker then move the pin and the values of latitude and longitude fill the textboxes

i use javascript to add the values of textboxes into the listboxes but with no luck

you can see the script in that page

View 3 Replies View Related

JQuery :: Filling Different Listboxes On Form With Named ID

Jun 4, 2011

I have ONE page which consists of php, html, and javascript, all on the same page. I have 3 different listboxes on a form, their named id's are: "strike", "grapple", and "strength". I have a span tag named id as: "pa". I Have a variable which is constant and named $totalValue and its vale is: 30, I have another variable named: $availableValue which will get its initial value from $totalValue. What I want to do is this, a user will choose his/her first list box. When the uses clicks the arrow on the listbox it drops down filled with values to choose from, these values come from the $availableValue variable and should be displayed as: 1,2,3,4,5,etc,etc,etc, after the user makes their selection the value of $availableValue is decreased by the amount of the user's selected choice and the value of the $availableValue is displayed on the html part of the page in a span tag.

The user will then choose his/her second listbox, upon clicking that arrow the listbox drops down displaying the REMAINING values from $availableValue variable and displays them as: 1,2,3,etc,etc,etc, after the user makes their selection the value of $availableValue is decreased by the amount of the user's selected choice and the value of the $availableValue is displayed on the html part of the page in a span tag. The user will then choose the last listbox, and upon clicking its arrow the list drops down with the LAST REMAINING values from $availableValue and will be displayed as: 1,2,etc,etc, after the user makes their selection the value of $availableValue is decreased by the amount of the user's selected choice and the value of the $availableValue is displayed on the html part of the page in a span tag.

The user should be able to choose which ever listbox he/she wants as their first listbox. So for argument's sake lets say the user chooses listbox "grapple" first, but of course the user could have chosen any of the 3 listboxes first, but he/she choose "grapple" first. The "grapple" listbox should fill with values 1 to 30, ex: 1,2,3,4,up to 30, the user selects value 5 from "grapple", the $availableValue variable will decrease by 5 and the value of $availableValue is displayed in a span tag. The user then chooses listbox "strength", its values should be filled and displayed with values from 1 to 25, the user selects 8 from "strength", the $availableValue variable decreases by 8 and the value of $availableValue is displayed in a span tag. Finally the user selects listbox "stamina", it listbox displays the values from 1 to 17, the user selects 17 from "stamina" and the $availableValue variable decreases by 17 and the value of $availableValue is displayed in a span tag. All this should happen BEFORE I submit the form via php code.

The code below, including the html, is ALL on one page named: createfighter.php
$totalValue = 30;
$availableValue = $totalValue;
$action = $_REQUEST['action'];
$strike = $_POST['strike'];
$grapple = $_POST['grapple'];
$strength = $_POST['strength'];
?> .....

View 1 Replies View Related

Populate Listboxes From Local XML File Without Security Warning....

May 24, 2007

I have been trawling everywhere, I cannot find a solution anywhere for the following:

I need a webpage with two list boxes and a text box, I want the two listboxes to be dynamic/cascading (the second dependant upon the choice in the first).

And the textbox dependant upon the selection from the second listbox.

This data has to come from a XML file stored on the local PC or Network drive.

Most importantly I do not want the user of the page to be prompted with the activeX warning.

The PC's are secure so I cannot tweak the reg, it gotta work completely with XML, XSL, Javascript etc only Can this be done if so please can someone post a simple example.

View 1 Replies View Related

JQuery :: Listbox Code Not Working - Two Drop-down Listboxes On A Page

Jun 12, 2011

I have two drop-down listboxes on a page. One listbox is visible and named sParent the other is suppose to be hidden and is named sChild. There are only 2 option values in the sParent listbox and they are vParent and vChild. If the user chooses the vChild option from the sParent listbox, than the second listbox named sChild is suppose to become visible, but if the users chooses any other option value or no option value at all from the sParent listbox the sChild listbox is to remain hidden. Below is the jquery code I am using, and below that is my html code:

View 2 Replies View Related

How To Make A Button Dependent

Jun 17, 2009

My objective is to have my buttons not to fuction when javascript is turned off. Can someone hepl me with the code.

View 2 Replies View Related

Dependent Coutry City Drop Down Box

Mar 1, 2006

i want to have 2 dpendent drown box. one for country , and the other for city. if you change country in box1 , the city list will also change in box2.. How to do it in javascript ? can you provide an example with few dumy country name and their cities.

View 2 Replies View Related

Calendar Dependent On Radio Button

Aug 24, 2010

I am working a form with radio button and calendar. What I would like to do is when the user selects Done - be able to display the calendar and if Not Done is selected, disable the calendar.

View 1 Replies View Related

Dependent Drop-down With Selections In An Array?

Sep 12, 2011

My current project is available for perusal in order to assist me at: [URL]As you can see, I make it so that once the product type is selected, you can then select a wattage. This dependent drop-down works, however I want it so that when I select a value in the left-hand side (wattage), then the one on the right will offer a pre-defined value that replaces the wattage I have.

For example, a GU-10 in 'Type of Lamp' offers a 50, 35 and 20 watt bulb in 'Current Lighting Products'. In 'Energy Efficient Products', it offers 5 and 3. I wish to make a statement somewhere so that if they select 50 on the left, it selects 5 on the right. If they select 35 on the left, it select 3 on the right.

I would also like it to do multiple offers, so that if they select say, a 35 of the MR-16, I want the right hand side to offer both 5 and 3. The only way I can think of doing this is via a lot of 'IF' statements.

View 13 Replies View Related

Javascript Database Dependent Dropdowns?

Sep 13, 2006

How would I make my page I have connect to a database using javascript dependent dropdowns? I have all the things I need to get the database working where it displays all the info in the database but I only want it to display based on what they select not all of it.

<?php require_once('Connections/conn_dj.php'); ?>
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
return $theValue;

mysql_select_db($database_conn_dj, $conn_dj);
$query_rs_industry = "SELECT * FROM tbl_industry ORDER BY industry_name ASC";
$rs_industry = mysql_query($query_rs_industry, $conn_dj) or die(mysql_error());
$row_rs_industry = mysql_fetch_assoc($rs_industry);
$totalRows_rs_industry = mysql_num_rows($rs_industry);

mysql_select_db($database_conn_dj, $conn_dj);
$query_rs_productcategory = "SELECT * FROM tbl_productcat ORDER BY tbl_productcat.productCat_name";
$rs_productcategory = mysql_query($query_rs_productcategory, $conn_dj) or die(mysql_error());
$row_rs_productcategory = mysql_fetch_assoc($rs_productcategory);
$totalRows_rs_productcategory = mysql_num_rows($rs_productcategory);

mysql_select_db($database_conn_dj, $conn_dj);
$query_rs_product = "SELECT * FROM tbl_products ORDER BY tbl_products.products_name";
$rs_product = mysql_query($query_rs_product, $conn_dj) or die(mysql_error());
$row_rs_product = mysql_fetch_assoc($rs_product);
$totalRows_rs_product = mysql_num_rows($rs_product);

mysql_select_db($database_conn_dj, $conn_dj);
$query_rs_outsidena = "SELECT * FROM intl_countries ORDER BY";
$rs_outsidena = mysql_query($query_rs_outsidena, $conn_dj) or die(mysql_error());
$row_rs_outsidena = mysql_fetch_assoc($rs_outsidena);
$totalRows_rs_outsidena = mysql_num_rows($rs_outsidena);

mysql_select_db($database_conn_dj, $conn_dj);
$query_rs_state = "SELECT * FROM tbl_states ORDER BY tbl_states.`state`";
$rs_state = mysql_query($query_rs_state, $conn_dj) or die(mysql_error());
$row_rs_state = mysql_fetch_assoc($rs_state);
$totalRows_rs_state = mysql_num_rows($rs_state);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<title>DICKEY-john Corporation | Distributors</title>
<link href="_lib/sub.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="keywords" content="Distributor, Sales, Purchase, U.S., International" />
<meta name="description" content="Enter your zip or postal code to find the DICKEY-john distributor nearest you." />

<div id="black">&nbsp;</div>
<div id="siteContainer">
<?php include("_inc/"); ?>
<div id="headerContainer">Distributors</div>
<div class="divContainer"><div class="horizDiv"></div><img src="/_img/divEnd.png" alt="div" height="16" width="4" align="right" /></div>
<div id="contentContainer">
<div id="fullContainer">
<div id="stretchCrumbs">
<a href="/index.php">Home</a>
» <a class="high" href="/distributors/">Distributors</a>
<p>Search for DICKEY-john distributers by specifying any combonation of the<br />
following classifications: industry, product category, product, and state.</p>
<br />

<br />

<h2>North America</h2>

<table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0">
<select name="industry" id="center">
<option value="">Select an Industry...</option>
<?php do { ?>
<option value="<?php echo $row_rs_industry['industry_name']; ?>"><?php echo $row_rs_industry['industry_name']; ?></option>

<?php } while ($row_rs_industry = mysql_fetch_assoc($rs_industry)); ?>
<tr><td width="125">Product Category: </td> <td>
<select name="prodcat" id="center">
<option value="">Select a product category...</option>
<?php do { ?>
<option value="<?php echo $row_rs_productcategory['productCat_name']; ?>"><?php echo $row_rs_productcategory['productCat_name']; ?></option>

<?php } while ($row_rs_productcategory = mysql_fetch_assoc($rs_productcategory)); ?>
<td>Product:</td> <td>
<select name="prod" id="center">
<option value="">Select a product...</option>
<?php do { ?>
<option value="<?php echo $row_rs_product['products_name']; ?>"><?php echo $row_rs_product['products_name']; ?></option>
<?php } while ($row_rs_product = mysql_fetch_assoc($rs_product)); ?>

</select> </td></tr>
<td> <select name="state" id="center">
<option value="">Select a state...</option>
<?php do { ?>
<option value="<?php echo $row_rs_state['state']; ?>"><?php echo $row_rs_state['state']; ?></option>
<?php } while ($row_rs_state = mysql_fetch_assoc($rs_state)); ?>

<tr><td>&nbsp;</td><td><input class="PythonButton" type="submit" value="Find" name="{Button_Name}"></td></tr>

<br />
<h2>Outside North America </h2>
<table class="setTbl listTbl" width="90%" cellpadding="0" cellspacing="0" border="0">
<tr><td> <select name="outna" id="center" onchange="javascript:document.centerform.submit()">
<option value="">Select a country...</option>
<?php do { ?>
<option value="<?php echo $row_rs_ousidena['name']; ?>"><?php echo $row_rs_outsidena['name']; ?></option>
<?php } while ($row_rs_outsidena = mysql_fetch_assoc($rs_outsidena)); ?>

<?php include("_inc/"); ?>





View 3 Replies View Related

Is XMLHTTp Object Browser Dependent?

Aug 10, 2005


gives a system error number: -1072896658

I have declared the object using:

var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

It works with IE version 6.0.2600 but not with IE version 6.0.2800

Couldnt find wat tis error code 1072896658.

View 4 Replies View Related

Validating TextField Dependent On List/Menu Value

Jan 19, 2006

I am new to JavaScript and would really appreciate any help to solve my

I am using the blow code in my form to validate form fields. What I
would like to accomplish is that if when the list/menu (attribute6)
value is "Ja" then to make the TextField Pas Nr (attribute4)
required. And if when the list/menu (attribute6) value is "Nee" to
make the TextField Pas Nr (attribute4) not required.

I have tried to adjust the code with no success. I give up and hope
that someone can help me to the right direction! ....

View 1 Replies View Related

JQuery :: Dependent Select Change Event?

Jan 28, 2011

I have a two level dependent select function, when level 1 changed, level 2 will change content with level 1, level 2 only change when level 1 "changed", if I use javascript to change the level1 value, level 2 won't change,for exaplme:


the level 1 select will change to the option which value is 3, but it won't trigger the change event, therefore level 2 does not change anything, how to change level 1 by and trigger change event.

View 2 Replies View Related

JQuery :: Dependent Validation For Selected Item ?

Nov 22, 2011

I am using jquery validate js for my validation. I need to validate and pass the value for the below senario.

I am having a dropdown box which has 2 option. Option 1 and Option 2.

And I have few checkboxes with same name. Depending upon the dropdown selection it should show/hide some checkboxes. Using javascript and CSS these are working fine.

The problem I am having is with the Select All function. If I check Select All it checks the hidden field also. The requirement is to select only the fields which are visible not the hidden one. Please suggest me how to do this.


Here Value 3 and value 4 are common. If I select option Select Item 1 Value 1 will show and value 2 will be hide. If I select all it should not select value 2. As the name is common its selecting that also. It should not select value 2. This is the requirement

View 1 Replies View Related

Ajax :: Dynamic Dependent Cascading Select

Jan 11, 2011

creating --Dynamic dependent cascading select using Ajax.It should not use asp .net, I need to add the code in a text field to generate this kind of cascading customized initially we need to populate a select list from database. Then, on selecting an option the next select list needs to get populated with corresponding values, then again on selecting..the third list needs to get populated --this should happen dynamically(with no page refresh).

View 3 Replies View Related

Create Two Dropdownlists That Are Dependent In First Select Tag There Are 4 Selections

Apr 19, 2011

I have to create two dropdownlists that are dependent In my first select tag there are 4 selections ,,, year,quarter,month and week. and in second select it should automatically populate..If user select year from first select in second select values should be 1 to 365.. if quarter values in second select(dropdown) should be 1 to 4. if month 1 to 12 and if week is selected 1 to 7.


View 1 Replies View Related

Show/hide Layer Dependent On Browser

Jun 17, 2005

I'm using the scroll function with a layer containing a graphic that sits over the slider on the y axis. This works fine in IE but overhangs the lower scrollbar arrow in Netscape, Firefox and Opera, killing its functionality, so I'd like to hide it in these browsers.

Could someone show me the best way to work a function that says (taking the layer ID as 'Bar')

IF browser = IE
THEN 'Bar' = visible

or (better?)

IF browser <> IE
THEN 'Bar' = hidden

And how should I allow this to behave in Safari?

View 19 Replies View Related

Regular Expression Capture Dependent On Token Order?

Feb 8, 2007

I'm trying to write a WDDX deserializer (I know they exist, but I'm
not fond of what I've seen) and so far everything is hunky dory.
Rather than writing a full lexical analyzer, I'm just using RE's to
match the pieces of the WDDX schema that I care about. And everything
works except for the the recordset element. Below is the string I'm
trying to match and expression I'm using. The RE matches and populates
$2 and $3 with the correct captures, but $1 is left undefined. If I
switch the order of the rowCount and fieldNames attributes of the
recordset element, then the RE matches and populates all three
captures correctly. Any ideas? Code:

View 1 Replies View Related

JQuery :: Newest Version - Dependent Select Lists ?

Jun 21, 2009



How to work on the newest jquery version? how to modify this script to: when I select from 1st box sth, 2nd box appears?

View 1 Replies View Related

JQuery :: Validating 2 Dependent Input Field Values?

Nov 8, 2011

I am having 2 input fields. Both will have only the integer values. Its a minimum and maximum values. The condition is The minimum value of the 2nd input field should be greater than 1st input field. and 1st input field value should be minimum than 2nd input field. For that I tried with

Jquery Script

rules: {
minfield: {


View 1 Replies View Related

Make A Checkbox Dependent On A Radio Button Choice?

Feb 16, 2009

is it possible to make a checkbox dependent on a radio button choice? For instance in the code below, if someone were to choose the radio button with the value "admin", the checkbox value "full" (user_admin_f) would automatically be checked?

User: <input type="radio" name="user_admin" value="user" checked> 
Admin: <input type="radio" name="user_admin" value="admin">  
Full?: <input type="checkbox" name="user_admin_f" value="full">

View 4 Replies View Related

Dynamically Change The Day Dropdown Menu Dependent On The Month?

Jul 4, 2010

I have 3 selects in a form for day, month and year for the user to enter his/her birthday.What I'm looking for is a piece of code / script which will dynamically change the day dropdown menu dependent on the month which is selected to display the correct number of days, and also according to if it is a leap year.Ive tried looking on google but I'm not sure what the correct term is to look for?

View 11 Replies View Related

Displaying An Image Dependent On When Another HTML Document Is Modified

Oct 9, 2005

I have a site that is built with a frameset. What I would like to do is whenever I update a particular frame that contains the main content (ie. a news.html page), have it change a graphic in the navigation bar (ie. a separate .html document) to a glowing animated gif for 7 days. Since the news page doesn't load as the first page within the frameset, it would show that there was something new posted there.

I have a few JavaScript books around, and I -think- I know roughly what needs to be done, but I'm having trouble conjugating scripts.

I think it could be done by checking the date.lastModified against the current date, and if the abs difference was less than 7 days it would display news-anim.gif, else it would display news.gif - however I am not sure how to get the left navframe.html to read the date modified of news.html

Can anyone suggest any solutions (or know of any scripts out there?) or is this more of an issue that should be dealt with using cookies/something else?

View 13 Replies View Related

Dropdown Menu Showing Different Text Box Dependent On Selection

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

Copyrights 2005-15, All rights reserved