> Obviously this is not a PHP question. However, you never told us
which web browser and OS you are seeing this in. I think the behavior
is browser and operating system dependent.
The behavior was browser dependent, but, using the link to the
additional information on size, I was able to fix that problem.
However, I'm running into the problem of not getting the correct
information passed out of my drop down box.
I'm showing how the drop down box is being created, obviously leaving
out code for less important information (like how I connect to my
database since that isn't an issue or code for some functions that work).
function create_pairs2($q1)
{
#this function creates pairs for any query that wants member id plus
full name
$result=mysql_query($q1) or die("Unable to view data cp2\n");
while($row = mysql_fetch_array($result))
{
$value = $row['member_id'];
$name = createname($row['member_id'], $row['f_name'], $row['m_name'],
$row['n_name'], $row['l_name']);
$pairs[$value]=$name;
}
return $pairs;
}
function create_drop_down($identifier,$pairs,$multiple="")
{
$dropdown = "<select name='$identifier' multiple='$multiple' size=10>";
foreach($pairs AS $value => $name)
{
$dropdown .= "<option name='$value'>$name</option>";
}
$dropdown .= "</select>";
return $dropdown;
}
This code is in my form:
$con_names_query = "SELECT DISTINCT tgs_tgsstaff.member_id, f_name,
m_name, n_name, l_name
FROM tgs_tgsstaff, tgs_brst_outline, tgs_writer_story
WHERE ((tgs_tgsstaff.member_id = tgs_brst_outline.member_id)
OR (tgs_tgsstaff.member_id = tgs_writer_story.member_id))
ORDER BY tgs_tgsstaff.member_id";
$pairs = create_pairs2($con_names_query);
$list = create_drop_down("staff_name",$pairs);
print $list;
and this code handles the posting event (the rest of event is irrelevent):
if (isset($_POST['submit']))
{
$staff_id = $_POST['staff_name'];
print "staff number is $staff_id";
}
The problem is $staff_id keeps having the value of $name (from my
function create_pairs2) instead of $value.
Here's one of the lines in the drop box:
<option name=15>Christine Morgan</option>
Instead of $staff_id being '15', it has the value of 'Christine Morgan'.
Any ideas on where I went wrong?
Community email addresses:
Post message: php-list@yahoogroups.com
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
SPONSORED LINKS
Php mysql | Job postings |
YAHOO! GROUPS LINKS
- Visit your group "php-list" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.