[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] insert checkbox values into table from form
Ed LaFrance wrote:
> At 10:38 PM 07/29/2002 -0400, you wrote:
> >Ed LaFrance wrote:
> > > At 06:16 PM 07/29/2002 -0400, you wrote:
> > > >Hi all,
> > > >
> > > >Ok, I just abandoned the idea of a feedback log and
> > > >took Dan's suggestion to just update a table. I have it
> > > >working!
> > > >
> > > >but, I have some checkbox values so that the customer
> > > >can select *3* things. they are all named "name=important"
> > > >and the table is only getting the *first one* of the three.
> > > >
> > > >is there something special to be done to collect all 3
> > > >into one table field?
> > > >
> > > >thanks,
> > > >Aaron
> > > >Hazenet.net
> > >
> > > Haven't followed this thread from the beginning, but you
> > > might want to do a
> > > filter=nulltospace before (or during) the write to the table.
> > >
> > > - Ed L.
> > >
> >
> >this filter doesn't seem to correct it (if I did it right) you still
> >only get one of the values.
> >
> >any other ideas out there?
> >
> >thanks,
> >Aaron
>
> It does work, so I guess there is something else amiss. Some
> ways you could
> use it are:
>
> 1. As a param of the value tag, i.e.: [value
> filter=nulltospace name=foo]
>
> 2. Enclosing. i.e." [filter nulltospace][value foo][/filter]
>
> 3. Via perl with an mv_check, in which case you could just
> use a regex, i.e.:
>
> <input type=submit name=mv_c value="Submit Form">
>
> [set Submit Form]
> [calc]
> $Values->{foo} = $CGI->{foo} =~ s/\0+//g;
> return;
> [/calc]
> [/set]
>
> One of these should work for you.
>
> - Ed L.
thanks Ed for the input, but I still cant get it and I think
it is a matter of *when* the variable is declared. I tried
inserting a hidden value as you indicated above with the
filter, but since it is checkboxes, the value is not fully known
until the page has refreshed. I did a test and declared the
value as you mentioned on the results page with the
filter and it works, but since this is writing to a database, I
think it is writing to the db before the [value]'s are parsed
I hope that makes sense.
thanks,
Aaron