Hey there! any question in your mind? Ask It Now!.

Popular Categories

How to select drop down value using PHPQuery

+4 votes
asked in Programming by Paul
Hi all , I am trying to get all drop down values on bases of id but the problem is I am getting a single value as output but I want each value in an array using PHPQuery.

HTML Code :

<select name="product" id="product" class="dropdown" onChange="javascript:selectProduct(this, this.form);">

 <option value="">-- Select Products --</option>

 <option value="mobiles" selected>mobiles</option>

 <option value="tablets" >tablets</option>

 <option value="laptops" >laptops</option>

<option value="smartwatch" >smartwatch</option>


I am trying like this :

$products = $all['#products'];

foreach ($products as $products) {

echo pq($products)->text();

 echo '<br>';



please help asap.
commented by anonymous
$_post['your select tag name']

1 Answer

0 votes
answered by anonymous
not possible in this way.


you have to make string of all options then make a hidden textbox,

assign values string to that   textbox ,

then get textbox in php.

Related Questions

+1 vote
1 answer 698 views
+2 votes
3 answers 363 views
+2 votes
1 answer 224 views
+4 votes
1 answer 711 views
+6 votes
3 answers 7,425 views
+1 vote
1 answer 952 views
+5 votes
1 answer 329 views

Not a Member yet?

Ask to Folks Login

My Account
332 Folks are online
2 members and 330 guest online
Your feedback is highly appreciated