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

Popular Categories





How to select drop down value using PHPQuery

+4 votes
139 views
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>

</select>

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 536 views
0 votes
1 answer 357 views
+2 votes
3 answers 277 views
+2 votes
1 answer 138 views
+4 votes
1 answer 613 views
+6 votes
3 answers 6,802 views
+1 vote
1 answer 729 views

Not a Member yet?

Ask to Folks Login

My Account
132 Folks are online
0 members and 132 guest online
Your feedback is highly appreciated