On Fri, 30 May 2008 20:00:51 -0500, dba wrote:
Do not understand your reply. Default UA behavior? is to send the last
value of a hidden input with the same name? and only the selected
radio button?
In short, it's an HTML problem. Essentially, if you send of a form
<input type="hidden" name="my_field" value="1">
<input type="hidden" name="my_field" value="2">
<input type="hidden" name="my_field" value="3">
your $_POST results will show my_field == 3. Even interlacing a radio
button set with those like
<input type="radio" name="my_set" value="1">
<input type="hidden" name="my_field" value="1">
<input type="radio" name="my_set" value="2">
<input type="hidden" name="my_field" value="2">
<input type="radio" name="my_set" value="3">
<input type="hidden" name="my_field" value="3">
will have absolutely no effect on the valye of my_field, because there
is no way to really associate the hidden inputs with the radio inputs.
They're entirely separate controls.
There's two ways to resolve this: an html way and a php way. The html
way is to make each of the hidden fields DIFFERENT from the others, like
<input type="hidden" name="my_field_set1" value="1">
<input type="hidden" name="my_field_set2" value="2">
<input type="hidden" name="my_field_set3" value="3">
which then becomes
<input type="radio" name="my_set" value="1">
<input type="hidden" name="my_field_set1" value="1">
<input type="radio" name="my_set" value="2">
<input type="hidden" name="my_field_set2" value="2">
<input type="radio" name="my_set" value="3">
<input type="hidden" name="my_field_set3" value="3">
when you interlace, and you make your form processor look at the value
of my_field_set1, my_field_set2, or my_field_set3 depending on the value
of my_set.
The php way is that instead of sending out the hidden fields at all, you
save them in the session data, then pull them back out when the form is
processed, based on the value of my_set, almost exactly like the last
part of the html method. This way of doing things is probably better,
all things otherwise being equal, because it prevents the value of your
hidden field from being seen, corrupted, or otherwise invalid.
The code is working fine with the following exception. The query
is bring back member_id member_fname and member_lname. The query
concatenates the fname and lname but I also need the member_id with
the (radio button or select statement). I was trying to get the
member_id using the hidden input but can not get it to work.
The query's fine, What you're missing is a bit of understanding of how
THE BROWSER (the UA -- user agent) manages form data. Which is why it's
an HTML question in the first place.
--
52. I will hire a team of board-certified architects and surveyors to
examine my castle and inform me of any secret passages and abandoned
tunnels that I might not know about.
--Peter Anspach's list of things to do as an Evil Overlord