John K.
|
| Posted: 10/18/2004, 2:02 PM |
|
Hi there, i am trying to make something like a b2b application.
In a page i have a grid with a list of products (10 or more).
I want to put a checkbox in the grid so the user can select what he likes. The products he selects i want them to go to another table giving the product_id and the user_id from the sesion.
What is the easiest way to do that?
I am trying to do it with an editable grid and custom insert or afterexecute events but i have stucked in coding and trying. Is there a good example i can use?
Thanks in advance.
|
|
|
 |
hidran
Posts: 29
|
| Posted: 10/20/2004, 4:01 AM |
|
There are different ways of doing that . One could be:
1)Add a checkbox (hand coded or with html toolbox) switch to
html a give it a name as an array e.g:
<input type="checkbox" id="product" name="product[]" value=" {product_id}" />.
2) add a label as shown above with form toolbox, choose your product
id as control source .
When code is generated you will have a checkbox for every product having your product id as value.
The page who receives the form values will have
a variable $product as an array with the product id values chosen.
Imploding this value into a variable you can make a query
like:
"select * from products where product_id in $implodevariable";
$implodevariable would be something like:
$implodedvariable='('.implode("','",$product).')';
|
 |
 |
|