Hi,
I was wondering if someone could help with with a silly display problem i have my message list code. Im making a basic internal email package. I currently display an 'inbox' that is pretty standard.
I have it set up to hilight the line when the mouse hovers over it and it links to the specific message when you click anywhere on that line. The problem is, I want a checkbox in there to allow me to multiselect messages for deletion etc. But when I do this, clicking on the checkbox triggers the link to the message. Ive moved the checkbox outside the <a href> tag but now it appears on a different line.
Can anyone tell me what im doing wrong.
the css is as follows....
I was wondering if someone could help with with a silly display problem i have my message list code. Im making a basic internal email package. I currently display an 'inbox' that is pretty standard.
I have it set up to hilight the line when the mouse hovers over it and it links to the specific message when you click anywhere on that line. The problem is, I want a checkbox in there to allow me to multiselect messages for deletion etc. But when I do this, clicking on the checkbox triggers the link to the message. Ive moved the checkbox outside the <a href> tag but now it appears on a different line.
Can anyone tell me what im doing wrong.
PHP:
<ul>
<?php
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
?>
<li <?php if ($row['message_unread']) {echo "style='font-weight:bold;'";}?>>
<?php
if($row['message_to'] === $_SESSION['db_staffmember_id']) {
$query="SELECT * FROM StaffMembers WHERE staffmember_id =".$row['message_from'];
$personname = "from:";
} else {
$query="SELECT * FROM StaffMembers WHERE staffmember_id =".$row['message_to'];
$personname = "to:";
}
$staffresult = mysql_query($query) or die('Error, query failed');
$staffdetails = mysql_fetch_array($staffresult, MYSQL_ASSOC);
$personname .= $staffdetails['staffmember_forename']." ".$staffdetails['staffmember_surname'];
?>
<span id='messagecheckbox'><input type='checkbox' name='checkbox[]' id='checkbox[]' value='<?php echo $row['message_id'];?>'></span>
<a href='../messages/message_view.php?messageid=<?php echo $row['message_id'];?>'>
<span id='messagelistperson'><?php echo croptext($personname,14,"...");?></span>
<span id='messagelistsubject'><?php echo $row['message_subject'];?></span>
<span id='messagelistdate'><?php echo ukdatetime($row['message_date']);?></span></a>
</li>
<?php
}
?>
</ul>
the css is as follows....
PHP:
#subjectline {
position:absolute;
color:white;
top:7px;
left:20px;
display:block;
}
#messagebody {
max-width: 788px;
border-style: double;
border-width: 0px;
padding-left: 5px;
padding-bottom: 10px;
padding-right: 5px;
padding-top: 10px;
display: block;
color: black;
}
#messagedate {
position:absolute;
font-size: 0.8em;
color: #f8ff4a;
top:12px;
right:12px;
}
#messageslist ul {
font-size: 0.9em;
list-style-type: none;
max-width: 740px;
}
#messageslist li {
width:740px;}
#messageslist li a {
border-top-color: #959595;
border-bottom-color: #c6c6c6;
border-bottom-style: solid;
border-top-style: solid;
border-bottom-width: 1px;
border-top-width: 1px;
color: black;
display: block;
padding: 5px;
text-decoration: none;
}
#messageslist li a:hover {
background: #eeeeee;
}
#messageslist a em {
color: #333;
display: block;
}
#messagelistsubject {
position: absolute;
left:180px;
}
#messagelistdate {
position: absolute;
right: 32px;
font-size: .8em;
}
#messagecheckbox {
text-align: left;
}
#idbadge {
position: absolute;
z-index: 1001;
}
#idbadge img {
width:60%;
height:60%;
}