[ic] Use Checkboxes instead

Mike Heins interchange-users@icdevgroup.org
Fri Jan 17 17:10:01 2003


Quoting Jeff Dafoe (jeff@badtz-maru.com):
> > I need to allow the user to select products by using checkboxes instead
> > of typing the quantity amount in a text field. Anyone have any idea on
> > how to do this? If so your comments will be appreciated.
> 
>     I suspect if you set the name of the checkbox to the same thing that the
> quantity value is currently named and set the value of the checkbox to "1"
> it might do what you want.
> 

Thus we have the problem with checkboxes -- they are simply not sent
if not checked.

Therefore, you can't do:

    <input type=hidden name=mv_order_item value=foo>
    <input type=checkbox name=mv_order_quantity value=1>

    <input type=hidden name=mv_order_item value=bar>
    <input type=checkbox name=mv_order_quantity value=1>

Both will be ordered no matter what.

The only solution is to introduce some protocol of your own. Luckily
with IC and ActionMap, this is extremely easy to do.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

Being against torture ought to be sort of a bipartisan thing.
-- Karl Lehenbauer