Jump to content

ajax triple drop down menu


z99

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.