javascript - Get description from the second drop down menu -


i have form 2 select menus ! first 1 "cat" loaded automatically database. second 1 "soucat" loaded automatically using javascript when item selected first select menu.

the problem can't description second select menu send via $_post!

<form method="post" action="" oninput=""> <label>     <select name="cat" id="cat" onchange="getcat()">         <option value="-1">categories</option>         <?php         /* fill in drop down menu database */         ?>            </select> </label>  <label id="souscat">     <select id="soucat" name="soucat">         <option value='-1'>subcategories</option>      </select> </label>  <span class="fieldd" id="searchformm">     <input type="text" name="searchterm" id="searchterm" placeholder="product find ?" />     <button type="submit" class="monboutton" >find !</button> </span>  </form> 

now, i've set code store informations contained in form :

<?php                                            unset($cat);  if(isset($_post['cat'])) {$cat = explode('|', $_post['cat']);} else      $cat="";  unset($soucat);  if(isset($_post['soucat'])) {$soucat = mysql_real_escape_string($_post['soucat']);} else      {$soucat=""; echo "soucat still empty";}  unset($searchterm);  if(isset($_post['searchterm'])) {$searchterm =  mysql_real_escape_string($_post['searchterm']);} else      $searchterm=""; ?> 

and test , see :

echo  "the category is: ".$cat[1]."<br>"; echo  "the sub category is: ".$soucat."<br>"; echo "the searchterm is: ".$searchterm."<br>"; 

$cat[1] , $searchterm containing descriptions must contain. $soucat empty! don't know how deal problem.

think problem missing s :-) call $soucat , $souscat. post soucat , souscat.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -