pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lynna Landstreet <lynna@gallery44.org>
To: pgsql-php@postgresql.org
Subject: Question about checkboxes in forms
Date: Wed, 02 Jun 2004 20:44:11 -0400
Message-ID: <BCE3EC9B.1349%lynna@gallery44.org> (raw)

Hi folks,

I'm running into a bit of trouble processing a form I set up. When I extract
the information from $_POST after submitting the form, everything comes
through fine except for the one form field that uses checkboxes - only the
last value checked comes through in that one.

In my past experience, when using checkboxes in formmail scripts and the
like, what comes through is a list of the values checked, separated by
commas. Does it still work that way when capturing the form data with PHP?
If so, could the commas be throwing it off? I was expecting the contents of
$_POST[keywords] to be a string of keyword IDs separate by commas, which I
could then explode into an array, but instead I only get the last value
checked, as though each box checked replaced the previous one.

The keyword checkboxes are generated from the database, but from looking at
the source on the resulting web page the HTML seems to be fine. Each
checkbox looks something like this:

<input type="checkbox" name="keywords" value="152">

They all have the name "keywords", but that's the norm for checkboxes and
radio buttons, isn't it? Usually it just groups all the values for each
named group of checkboxes into one string, but not this time, apparently.

Any ideas?


Lynna

-- 
Resource Centre Database Coordinator
Gallery 44
www.gallery44.org




view thread (2+ messages)  latest in thread

Message-ID: <BCE3EC9B.1349%lynna@gallery44.org>
Permalink:  ../BCE3EC9B.1349%25lynna@gallery44.org/
Also on:    postgresql.org/message-id/BCE3EC9B.1349%lynna@gallery44.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: lynna@gallery44.org
  Subject: Re: Question about checkboxes in forms
  In-Reply-To: <BCE3EC9B.1349%lynna@gallery44.org>
  References: <BCE3EC9B.1349%lynna@gallery44.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox