[ic] Use Checkboxes instead

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


Quoting Kevin Walsh (kevin@cursor.biz):
> Mike Heins [mike@perusion.com] wrote:
> > Quoting Jeff Dafoe (jeff@badtz-maru.com):
> > > 
> > > 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.
> >
> The following test code works for me:
> 
> <form action="[process]" method="POST">
>     <input type="hidden" name="mv_todo" value="refresh">
>     foo: <input type="checkbox" name="mv_order_item" value="foo"><br>
>     bar: <input type="checkbox" name="mv_order_item" value="bar"><br>
>     <input type="submit" name="Checkbox test"><br>
> </form>
> 
> The quantity defaults to one so it doesn't need to be specified.
> 

That is correct. The problem is that you can't put quantities in....

-- 
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