html - How to get a request parameters like a associative array -
let have list of text fields. every text field responsible product id, , want know how items should buy.
the result parameters should { :1 => 2, :5 => 8 }
, means user buy 2 items of product id 1, , 8 items of product id 5.
what's expected name
attributes of expected input[type="text"]
html tags case?
let's have
<input type="text" name="product<?php echo $product_id; >"></input>
you can submit value using jquery
var x = $('input[name=\'product' + pid + '\']').val(); // pid product_id
on server can use
$this->request->get['product'.$pid];//pid product_id
Comments
Post a Comment