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 547 views
0 votes
1 answer 405 views
+4 votes
5 answers 718 views
0 votes
1 answer 9,844 views
+2 votes
3 answers 283 views
asked in Programming by jatin Expert (3,823 points)
+2 votes
1 answer 145 views
+4 votes
1 answer 615 views
+6 votes
3 answers 6,836 views
+1 vote
1 answer 739 views

Not a Member yet?

Ask to Folks Login

My Account
606 Folks are online
89 members and 517 guest online
Your feedback is highly appreciated