z99 Posted March 21, 2010 Share Posted March 21, 2010 in my region table i have 4 fields=>id,oid,cid,name [oid and cid are primary key which refer to ostan and city tables] in the third drop down menu when region is selected this codes will be executed: else if($data=='region') { //third dropn down menu echo "<select name='region' >\n"; echo "<option value='0'>====choose region====</option>\n"; $qth="select id,name from region where oid='$oid' and cid='$val'"; ************HERE************** $exeqth=mysql_query($qth,$l); while($res3=mysql_fetch_array($exeqth)) { echo "<option value=\"$res3[id]\" >$res3[name]</option> \n" ; } }//close for if region as you see i have to check,oid [which refers to countrty table] and cid [which refers to city table],in order to show the region that is really belong to country and the city that the user has been select,there is $val that contains the selection,unfortunately it will save the selection from the first drop down menu,i should deal with $val,because this is the variable that contain the selection,how can save each value from each drop down menu in 3 variables $country,$city,$region, [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/196004-ajax-triple-drop-down-menu/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.