drop down pblm in php ?...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ajaymohank
    New Member
    • Jan 2008
    • 29

    #1

    drop down pblm in php ?...

    Hello friends........ .

    i have 3 drop down,district,t aluk and village. based on the district, corresponding taluk will be filled and based on taluk selected corresponding village will be filled. when i submitt the form, i want to enter village id and name to the table. my village dropdown value is village id. so i can enter village id to table but not village name... how can enter both id and name to table. name and id r 2 fields in the tables.

    thanks.
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Couldn't understand your problem.
    Show the code.

    Comment

    • media3000anthony
      New Member
      • Mar 2008
      • 4

      #3
      Hello ajaymohank,

      Why not generate the dropdown like this:
      [HTML]<form action='form_pr ocessor.php' action='post'>
      <select name='village'>
      <option value='1|Chande ri'>Chanderi</option>
      <option value='5|Balend er'>Balender</option>
      <option value='8|Porban der'>Porbander</option>
      </select>
      </form>[/HTML]

      Then in the PHP (form_processor .php):
      [PHP]$arrVillage = split('|', $_POST['village']);
      $villageId = $arrVillage[0];
      $villageName = $arrVillage[1];
      [/PHP]

      I hope I have understood your question.

      Regards,
      Anthony

      Comment

      Working...