CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 multiple checkboxes to get multiple products

Print topic Send  topic

Author Message
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).')';
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.