[WEB4LIB] Forms with checkboxes

Darryl Friesen Darryl.Friesen at usask.ca
Fri May 14 11:02:45 EDT 1999


> At the request of our company's General Manager Marketing I've created a
> form that staff can use on the intranet for ordering marketing resources
> (I'm responsible for the company's intranet as well as the library's pages).
> The form's functionality is no problem, but what comes through in the email
> message is pretty ugly. Only the orders that have had their boxes checked
> appear in the email, which is what I want, but how do I prevent all the
> empty "Quantity" fields for the unchecked products being returned as well?
> I'm hoping someone will enlighten me.

What you really need is to submit the form to a CGI program that can properly
format the results, then email to the appropriate person(s)

> This is the code I've used in the form:

Technically, you cannot have multiple INPUT fields with the same name, i.e.
the three you have named "Quantity"; each should have a unique name (like
Quantity1, Quantity2 etc, or MousepadQuantity, PenQuantity ...)

I don't know if that will help the empty fields or not.  It simply may be that
the browser returns all (text) INPUT fields, empty or not, but only those
checkbox fields that are checked.  Again, a CGI program could contain the
logic you need to remove the empty fields from email that it generates.


- Darryl

  ----------------------------------------------------------------------
   Darryl Friesen, B.Sc., Programmer/Analyst    Darryl.Friesen at usask.ca
   Consulting & Development                     http://gollum.usask.ca/
   Department of Computing Services                 163 Murray Building
   University of Saskatchewan                              Main Library
  ----------------------------------------------------------------------
  "The Truth Is Out There"



More information about the Web4lib mailing list