Re: following radio & hidden does not work..... help please.
- From: dba <someone@xxxxxxxxxxxxx>
- Date: Sat, 31 May 2008 15:38:34 -0500
Again, quit asking for people to follow an idiotic practice like bottom posting. It's NOT going to happen. If you and a few other zealots want to continue to be members of the flat earth society fine. Good for you!
| Then post a URL, your query and relevant PHP code.
Maybe I am doing this work on my computer and not the net. Ever think of that?
|If I loop through a recordset and the resulting HTML is like this:
|<select name="foo">
|<option value="1" selected>1</option>
|<option value="2" selected>2</option>
|<option value="3" selected>3</option>
|</select>
|Then foo will post with an array with three values, eg foo = 1, 2, 3.
Correction, then foo will = 1 OR 2 OR 3.
Actually you are finally getting close.
I are trying to present the user with a select form where they can choose
from a select list of member names. This could be tens to perhaps a hundred or more. So you query the database for records and present the concatenated fname and lname for the user to choose from. The database contains the three field needed to add information. They are member_id and member_fname and member_lname.
Actually there are more fields but these are the ones I need.
The select OR radio will only let me $_POST one variable. I need more variables sent to the ACTION program post_data.php. That is why I was trying to use the hidden input to send the other variables but I could not get this to work.
My question was how can I get 3 or more variable sent to the ACTION program for processing.
Adrienne Boswell wrote:
Gazing into my crystal ball I observed dba <someone@xxxxxxxxxxxxx>.
writing in news:4841560a$0$31733$4c368faf@xxxxxxxxxxxxxx:
Again, please do not top post.
Adrienne Boswell wrote:Gazing into my crystal ball I observed dba <someone@xxxxxxxxxxxxx>This is NOT a server side question! This is a HTML or PHP question!
writing in news:4840a527$0$4112$4c368faf@xxxxxxxxxxxxxx:
Please do not top post. See bottom of post.
cwdjrxyz wrote:This is a server side question, and more importantly a db question. What is your query, and what results are returned from the query?On May 30, 4:42 pm, dba <some...@xxxxxxxxxxxxx> wrote:How much code do you need? The question is fairly simple. Using ausing the following code with a problem....I agree with the answer you were given in comp.lang.php. In plain
echo "<input type='hidden' name='member_id'
value=\"{$row[0]}\">{$row[0]}";
echo "<input type='radio' name='member_name'
value=\"{$row[1]}\">{$row[1]}<br />";
The post_data.php program posts the following
member id is: 0009
member_name is: Ralph Jones
cccb_name is: Annexation Committee
Everything is ok but the member id. The number listed '0009' is
the number of the last name in the returned result. It is NOT the
number listed with Ralph Jones which is '0007'.
This works the same with a radio button or a select statement.
Any help will be appreciated.
English, it says that you are unlikely to get help on this question
anywhere unless you post a more complete version of the code or a
working example on a web site(the best way).
radio input or a select input can you get multiple variables
returned.
Three variables are needed
member_id
member_fname
member_lname
Current sql returns concatenated fname and lname. I can not get
third variable to POST in action php code.
The query and database return exactly what they should!
Using a HTML radio button form as previously stated returns all the
data as requested. The problem seems to be HOW does one get more than
one database variable to be (transfered?) to the PHP action program.
The objective of the form is to use either a (prefered select form) or
a radio button form so a user can select a person from the database.
The query works! What does not is not clear to me. Either the HTML
Select form or the HTML radio button form or the PHP which makes up
the ACTION=post.php program.
It seems that good old HTML and/or PHP will not let me build a form
that will allow more than ONE variable to be $_POSTed to the php
program.
I have built both radio and select. Can not find a way to bring more
that one variable back to the post.php program for posting to the
database.
Then post a URL, your query and relavent PHP code.
If I loop through a recordset and the resulting HTML is like this:
<select name="foo">
<option value="1" selected>1</option>
<option value="2" selected>2</option>
<option value="3" selected>3</option>
</select>
Then foo will post with an array with three values, eg foo = 1, 2, 3.
If the HTML is like:
<input type="radio" name="bar[]" value="1">1
<input type="radio" name="bar[]" value="2">2
<input type="radio" name="bar[]" value="3">3
If the user does not select one of the radio buttons, the value of bar will not post.
- Follow-Ups:
- Re: following radio & hidden does not work..... help please.
- From: Beauregard T. Shagnasty
- Re: following radio & hidden does not work..... help please.
- References:
- Prev by Date: Re: Three dimensions pictures?
- Next by Date: Re: following radio & hidden does not work..... help please.
- Previous by thread: Re: following radio & hidden does not work..... help please.
- Next by thread: Re: following radio & hidden does not work..... help please.
- Index(es):