in my project i am using multiple combo boxes in a single page.so can u help me how to get values from those comboboxes.here me used nearly 400 comboboxes.so it is very difficult to use 400 variables to retrive value from comboboxes.so me used array technology.bt here me not able to use array variable in get or post method.it showing error.so can u help me plz its very aurgent!

Recommended Answers

All 3 Replies

On your page give same id to all the combo boxes and place [] after their id. On your php page use this.

// I assume the id of all the boxes to be [B]boxes[][/B]
<?php
$boxes = $_POST['boxes'];

foreach($boxes as $k){
echo $k;    // will display the selected value of each combo box
        	// Or what you want to do with the boxes
}
?>

i am using array variables to get the values eg
$POST'];
i have to use variables as mentioned above

it is wrong $_POST is correct and instead of [1] use foreach loop.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.