helloise Posted January 10, 2011 Share Posted January 10, 2011 how come the lines: PHP Code: echo $form['catcher_id']; $catcher_names = $form['catcher_id'] foreach($catcher_names as $val) { echo "testing loop"; } produce nothing?? its not doing the foreach. $form['catcher_id']; is a dropdown list containing catcher names please help? thanks Link to comment https://forums.phpfreaks.com/topic/223957-looping-through-dropdown-list-problem/ Share on other sites More sharing options...
Pikachu2000 Posted January 10, 2011 Share Posted January 10, 2011 My first guess would be that $form['catcher_id'] might not be an array. What is the output of var_dump($form['catcher_id']); ? Link to comment https://forums.phpfreaks.com/topic/223957-looping-through-dropdown-list-problem/#findComment-1157376 Share on other sites More sharing options...
helloise Posted January 10, 2011 Author Share Posted January 10, 2011 $form['catcher_id'] gives me a dropdown list for the var_dump: how do i code this to see?? echo var_dump($form['catcher_id'])??? sorry me very new Link to comment https://forums.phpfreaks.com/topic/223957-looping-through-dropdown-list-problem/#findComment-1157383 Share on other sites More sharing options...
the182guy Posted January 10, 2011 Share Posted January 10, 2011 When you submit a dropdown list on a form it will only send the selected value, so just one value, not the entire list. Link to comment https://forums.phpfreaks.com/topic/223957-looping-through-dropdown-list-problem/#findComment-1157390 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.