[thelist] ajax dynamic dropdown menu set

Simon MacDonald simonmacdonald at uk2.net
Wed Aug 4 03:28:28 CDT 2010


Bob,

I think your problem is in the html generated by findCounty.php. The
generated html is missing an <option value> value:

Generated html:

<div style="margin-bottom: 1em;">
County
<span id="county_div"><select name="county"
onchange="getCity(2,this.value)">
<option>Select County</option>
<option value="">Santa Cruz County - ID: 4</option>
<option value="">San Mateo County - ID: 5</option>
<option value="">Santa Clara County - ID: 6</option>
</select>
(State ID: 2)</span>
</div>

In findCounty.php
You have:
<option value><?=$row['county']?> - ID: <?=$row['id']?>
Should have:
<option value<?=$row['id']?>><?=$row['county']?> - ID: <?=$row['id']?>

Hope that works

Simon

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Bob Meetin
Sent: 04 August 2010 5:29 AM
To: thelist at lists.evolt.org
Subject: Re: [thelist] ajax dynamic dropdown menu set

The three level multi-select works perfectly, but the need is for four 
level (Country, State, County and City), perhaps more in the future.  So 
I  modeled the syntax for the fourth level after third level, however it 
will not pass the value of county to findCity.php, always passes NULL/0.

You can see the demo at: http://www.dottedi.biz/code/ajax/4levelselect/

I made up a zip file with modified database at: 
http://www.dottedi.biz/code/ajax/4levelselect.zip . If you choose to 
test you will need to import the database (the file called sql) and 
update the mysql_connect.php file.

Bob

-- 

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt ! 
 

__________ Information from ESET Smart Security, version of virus signature
database 5338 (20100803) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
 

__________ Information from ESET Smart Security, version of virus signature
database 5338 (20100803) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 



More information about the thelist mailing list