After the click does not appear in boldHow do I detect a click outside an element?How to manage a redirect request after a jQuery Ajax callHow to Check if element is visible after scrolling?How does JavaScript .prototype work?What does “use strict” do in JavaScript, and what is the reasoning behind it?Why does Google prepend while(1); to their JSON responses?Why does ++[[]][+[]]+[+[]] return the string “10”?How does data binding work in AngularJS?Why does my JavaScript code get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?How does Facebook disable the browser's integrated Developer Tools?
Olympic game scoring
A group-like structure with multiplicative zero instead of the identity
Why does the speed of sound decrease at high altitudes although the air density decreases?
How do I say "quirky" in German without sounding derogatory?
Make 2019 with single digits
Permutations in Disguise
Where is it? - The Google Earth Challenge Ep. 2
Examples of proofs by making reduction to a finite set
Is there any reason to concentrate on the Thunderous Smite spell after using its effects?
Are there any rules about taking damage whilst holding your breath in combat?
Why is the Digital 0 not 0V in computer systems?
What is the mathematical notation for rounding a given number to the nearest integer?
Usage of blank space in trade banner and text-positioning
A Mainer Expression
Why don't Wizards use wrist straps to protect against disarming charms?
How to give my students a straightedge instead of a ruler
How are aircraft depainted?
geschafft or geschaffen? which one is past participle of schaffen?
Why is my fire extinguisher emptied after one use?
Output a Super Mario Image
Has SHA256 been broken by Treadwell Stanton DuPont?
What is the name of this Allen-head furniture fastener?
Would it be unbalanced to increase Wild Shape uses based on level?
What do the French say for “Oh, you shouldn’t have”?
After the click does not appear in bold
How do I detect a click outside an element?How to manage a redirect request after a jQuery Ajax callHow to Check if element is visible after scrolling?How does JavaScript .prototype work?What does “use strict” do in JavaScript, and what is the reasoning behind it?Why does Google prepend while(1); to their JSON responses?Why does ++[[]][+[]]+[+[]] return the string “10”?How does data binding work in AngularJS?Why does my JavaScript code get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?How does Facebook disable the browser's integrated Developer Tools?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I created an internal email system within the project. When I receive a new message the column with the subject name in my table is bolded to inform that the message has not yet been read.
code:
<?php
while($row = mysqli_fetch_array($result))
?>
<section id="s1">
<div class="div1" id="minhaDiv" style="float: left;">
<table class="table table-bordered">
<tr>
<th width="20%">De</th>
<th width="60%">Assunto</th>
<th width="10%">Prioridade</th>
<th width="10%">Recebido</th>
</tr>
<tr>
<th width="10%" colspan=4>Recebido: <?php echo $row["Data"]; ?></th>
</tr>
<tr>
<td><?php echo $row["De"]; ?></td>
<td class="td-info view_data" id="<?php echo $row["Id"]; ?>" data-toggle="modal" href="#dataModal" width="20%" style="font-weight:bold" onclick="this.style['font-weight'] ='normal'"><?php echo $row["Assunto"]; ?></td>
<td><?php echo $row["Prioridade"]; ?></td>
<td><?php echo $row["Hora"]; ?></td>
</tr>
<tr>
<?php
?>
</table>
</div>
</section>
In the image, which is surrounded by green already clicked to read, the red has not yet vliquei to read, so it is bold:
I use this code to put bold inside the td
:
width="20%" style="font-weight:bold" onclick="this.style['font-weight'] ='normal'"
The problem is that if you refresh the page, even after reading the messages, they come back in bold and should not. After clicking once, they can not be left in bold
javascript jquery
|
show 9 more comments
I created an internal email system within the project. When I receive a new message the column with the subject name in my table is bolded to inform that the message has not yet been read.
code:
<?php
while($row = mysqli_fetch_array($result))
?>
<section id="s1">
<div class="div1" id="minhaDiv" style="float: left;">
<table class="table table-bordered">
<tr>
<th width="20%">De</th>
<th width="60%">Assunto</th>
<th width="10%">Prioridade</th>
<th width="10%">Recebido</th>
</tr>
<tr>
<th width="10%" colspan=4>Recebido: <?php echo $row["Data"]; ?></th>
</tr>
<tr>
<td><?php echo $row["De"]; ?></td>
<td class="td-info view_data" id="<?php echo $row["Id"]; ?>" data-toggle="modal" href="#dataModal" width="20%" style="font-weight:bold" onclick="this.style['font-weight'] ='normal'"><?php echo $row["Assunto"]; ?></td>
<td><?php echo $row["Prioridade"]; ?></td>
<td><?php echo $row["Hora"]; ?></td>
</tr>
<tr>
<?php
?>
</table>
</div>
</section>
In the image, which is surrounded by green already clicked to read, the red has not yet vliquei to read, so it is bold:
I use this code to put bold inside the td
:
width="20%" style="font-weight:bold" onclick="this.style['font-weight'] ='normal'"
The problem is that if you refresh the page, even after reading the messages, they come back in bold and should not. After clicking once, they can not be left in bold
javascript jquery
1
Where specifically in your code do you make the text bold? On what condition do you perform that operation? Why specifically do you expect that condition to change after a message has been read?
– David
Mar 28 at 11:11
@David I do not understand, I put the td "Subject" in bold, inside the td, then when I click it is no longer in bold, but I have no condition. I want to make only the new messages in bold, to know the ones I have not read yet
– Bruno Pinto
Mar 28 at 11:17
"but I have no condition" - Sounds like you need one. "I want to make only the new messages in bold" - And it sounds like you already know what that condition is. When you're rendering this data, conditionally make the text bold based on whether or not the message has been read. How do you track that information? Once you have that information, it sounds like what you're looking for is called anif
statement in PHP.
– David
Mar 28 at 11:19
@BrunoPinto you will have to setup your messages table in database for read/unread messages, i.e. make a column read, if receiver read the message put 1 else zero, this is how you will get a read value while looping.
– Shoyeb Sheikh
Mar 28 at 11:22
@Shoyeb Sheikh I added an answer with the creation of a field in the table where I will be able to create the condition. Now how do I create the condition inside theTD
. I'm trying like this:width="20%" style="font-weight:bold" onclick="if(<?php echo $row["Status"] == '1'; ?> )this.style['font-weight'] ='normal'"
, but it does not
– Bruno Pinto
Mar 28 at 12:35
|
show 9 more comments
I created an internal email system within the project. When I receive a new message the column with the subject name in my table is bolded to inform that the message has not yet been read.
code:
<?php
while($row = mysqli_fetch_array($result))
?>
<section id="s1">
<div class="div1" id="minhaDiv" style="float: left;">
<table class="table table-bordered">
<tr>
<th width="20%">De</th>
<th width="60%">Assunto</th>
<th width="10%">Prioridade</th>
<th width="10%">Recebido</th>
</tr>
<tr>
<th width="10%" colspan=4>Recebido: <?php echo $row["Data"]; ?></th>
</tr>
<tr>
<td><?php echo $row["De"]; ?></td>
<td class="td-info view_data" id="<?php echo $row["Id"]; ?>" data-toggle="modal" href="#dataModal" width="20%" style="font-weight:bold" onclick="this.style['font-weight'] ='normal'"><?php echo $row["Assunto"]; ?></td>
<td><?php echo $row["Prioridade"]; ?></td>
<td><?php echo $row["Hora"]; ?></td>
</tr>
<tr>
<?php
?>
</table>
</div>
</section>
In the image, which is surrounded by green already clicked to read, the red has not yet vliquei to read, so it is bold:
I use this code to put bold inside the td
:
width="20%" style="font-weight:bold" onclick="this.style['font-weight'] ='normal'"
The problem is that if you refresh the page, even after reading the messages, they come back in bold and should not. After clicking once, they can not be left in bold
javascript jquery
I created an internal email system within the project. When I receive a new message the column with the subject name in my table is bolded to inform that the message has not yet been read.
code:
<?php
while($row = mysqli_fetch_array($result))
?>
<section id="s1">
<div class="div1" id="minhaDiv" style="float: left;">
<table class="table table-bordered">
<tr>
<th width="20%">De</th>
<th width="60%">Assunto</th>
<th width="10%">Prioridade</th>
<th width="10%">Recebido</th>
</tr>
<tr>
<th width="10%" colspan=4>Recebido: <?php echo $row["Data"]; ?></th>
</tr>
<tr>
<td><?php echo $row["De"]; ?></td>
<td class="td-info view_data" id="<?php echo $row["Id"]; ?>" data-toggle="modal" href="#dataModal" width="20%" style="font-weight:bold" onclick="this.style['font-weight'] ='normal'"><?php echo $row["Assunto"]; ?></td>
<td><?php echo $row["Prioridade"]; ?></td>
<td><?php echo $row["Hora"]; ?></td>
</tr>
<tr>
<?php
?>
</table>
</div>
</section>
In the image, which is surrounded by green already clicked to read, the red has not yet vliquei to read, so it is bold:
I use this code to put bold inside the td
:
width="20%" style="font-weight:bold" onclick="this.style['font-weight'] ='normal'"
The problem is that if you refresh the page, even after reading the messages, they come back in bold and should not. After clicking once, they can not be left in bold
javascript jquery
javascript jquery
edited Mar 28 at 11:11
MrMaavin
9331 gold badge10 silver badges19 bronze badges
9331 gold badge10 silver badges19 bronze badges
asked Mar 28 at 11:07
Bruno PintoBruno Pinto
617 bronze badges
617 bronze badges
1
Where specifically in your code do you make the text bold? On what condition do you perform that operation? Why specifically do you expect that condition to change after a message has been read?
– David
Mar 28 at 11:11
@David I do not understand, I put the td "Subject" in bold, inside the td, then when I click it is no longer in bold, but I have no condition. I want to make only the new messages in bold, to know the ones I have not read yet
– Bruno Pinto
Mar 28 at 11:17
"but I have no condition" - Sounds like you need one. "I want to make only the new messages in bold" - And it sounds like you already know what that condition is. When you're rendering this data, conditionally make the text bold based on whether or not the message has been read. How do you track that information? Once you have that information, it sounds like what you're looking for is called anif
statement in PHP.
– David
Mar 28 at 11:19
@BrunoPinto you will have to setup your messages table in database for read/unread messages, i.e. make a column read, if receiver read the message put 1 else zero, this is how you will get a read value while looping.
– Shoyeb Sheikh
Mar 28 at 11:22
@Shoyeb Sheikh I added an answer with the creation of a field in the table where I will be able to create the condition. Now how do I create the condition inside theTD
. I'm trying like this:width="20%" style="font-weight:bold" onclick="if(<?php echo $row["Status"] == '1'; ?> )this.style['font-weight'] ='normal'"
, but it does not
– Bruno Pinto
Mar 28 at 12:35
|
show 9 more comments
1
Where specifically in your code do you make the text bold? On what condition do you perform that operation? Why specifically do you expect that condition to change after a message has been read?
– David
Mar 28 at 11:11
@David I do not understand, I put the td "Subject" in bold, inside the td, then when I click it is no longer in bold, but I have no condition. I want to make only the new messages in bold, to know the ones I have not read yet
– Bruno Pinto
Mar 28 at 11:17
"but I have no condition" - Sounds like you need one. "I want to make only the new messages in bold" - And it sounds like you already know what that condition is. When you're rendering this data, conditionally make the text bold based on whether or not the message has been read. How do you track that information? Once you have that information, it sounds like what you're looking for is called anif
statement in PHP.
– David
Mar 28 at 11:19
@BrunoPinto you will have to setup your messages table in database for read/unread messages, i.e. make a column read, if receiver read the message put 1 else zero, this is how you will get a read value while looping.
– Shoyeb Sheikh
Mar 28 at 11:22
@Shoyeb Sheikh I added an answer with the creation of a field in the table where I will be able to create the condition. Now how do I create the condition inside theTD
. I'm trying like this:width="20%" style="font-weight:bold" onclick="if(<?php echo $row["Status"] == '1'; ?> )this.style['font-weight'] ='normal'"
, but it does not
– Bruno Pinto
Mar 28 at 12:35
1
1
Where specifically in your code do you make the text bold? On what condition do you perform that operation? Why specifically do you expect that condition to change after a message has been read?
– David
Mar 28 at 11:11
Where specifically in your code do you make the text bold? On what condition do you perform that operation? Why specifically do you expect that condition to change after a message has been read?
– David
Mar 28 at 11:11
@David I do not understand, I put the td "Subject" in bold, inside the td, then when I click it is no longer in bold, but I have no condition. I want to make only the new messages in bold, to know the ones I have not read yet
– Bruno Pinto
Mar 28 at 11:17
@David I do not understand, I put the td "Subject" in bold, inside the td, then when I click it is no longer in bold, but I have no condition. I want to make only the new messages in bold, to know the ones I have not read yet
– Bruno Pinto
Mar 28 at 11:17
"but I have no condition" - Sounds like you need one. "I want to make only the new messages in bold" - And it sounds like you already know what that condition is. When you're rendering this data, conditionally make the text bold based on whether or not the message has been read. How do you track that information? Once you have that information, it sounds like what you're looking for is called an
if
statement in PHP.– David
Mar 28 at 11:19
"but I have no condition" - Sounds like you need one. "I want to make only the new messages in bold" - And it sounds like you already know what that condition is. When you're rendering this data, conditionally make the text bold based on whether or not the message has been read. How do you track that information? Once you have that information, it sounds like what you're looking for is called an
if
statement in PHP.– David
Mar 28 at 11:19
@BrunoPinto you will have to setup your messages table in database for read/unread messages, i.e. make a column read, if receiver read the message put 1 else zero, this is how you will get a read value while looping.
– Shoyeb Sheikh
Mar 28 at 11:22
@BrunoPinto you will have to setup your messages table in database for read/unread messages, i.e. make a column read, if receiver read the message put 1 else zero, this is how you will get a read value while looping.
– Shoyeb Sheikh
Mar 28 at 11:22
@Shoyeb Sheikh I added an answer with the creation of a field in the table where I will be able to create the condition. Now how do I create the condition inside the
TD
. I'm trying like this: width="20%" style="font-weight:bold" onclick="if(<?php echo $row["Status"] == '1'; ?> )this.style['font-weight'] ='normal'"
, but it does not– Bruno Pinto
Mar 28 at 12:35
@Shoyeb Sheikh I added an answer with the creation of a field in the table where I will be able to create the condition. Now how do I create the condition inside the
TD
. I'm trying like this: width="20%" style="font-weight:bold" onclick="if(<?php echo $row["Status"] == '1'; ?> )this.style['font-weight'] ='normal'"
, but it does not– Bruno Pinto
Mar 28 at 12:35
|
show 9 more comments
1 Answer
1
active
oldest
votes
Solution to achieve the condition.
I created a Status
field in the database table, where 1 is unread message and 0 message is read, now is to create the condition in td with if
. In the javascript with which I open the modal I made the following change:
$('.td-info').click(function()
var item_id = $(this).attr("id");
var status = $(this).attr("Status");
$.ajax(
url:"./fetchRAD",
method: "POST",
data:item_id:item_id, status:status,
success:function(data)
);
);
In td
I indicated the id
of the record in the id
of td
:
id="<?php echo $row["Id"]; ?>"
file with php
:
if(isset($_POST["item_id"]))
$query = "Update centrodb.Alertas SET Status = '0' WHERE Id = '".$_POST["item_id"]."'";
$result = mysqli_query($conn, $query);
Pata check in the td
we put like this:
width="20%" <?php echo $row["Status"] == '1'?' style="font-weight:bold" ':' style="font-weight:normal" '?>
td
complete:
<td class="td-info view_data" id="<?php echo $row["Id"]; ?>" data-toggle="modal" href="#dataModal" width="20%" <?php echo $row["Status"] == '1'?' style="font-weight:bold" ':' style="font-weight:normal" '?>><?php echo $row["Assunto"]; ?></td>
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55396047%2fafter-the-click-does-not-appear-in-bold%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Solution to achieve the condition.
I created a Status
field in the database table, where 1 is unread message and 0 message is read, now is to create the condition in td with if
. In the javascript with which I open the modal I made the following change:
$('.td-info').click(function()
var item_id = $(this).attr("id");
var status = $(this).attr("Status");
$.ajax(
url:"./fetchRAD",
method: "POST",
data:item_id:item_id, status:status,
success:function(data)
);
);
In td
I indicated the id
of the record in the id
of td
:
id="<?php echo $row["Id"]; ?>"
file with php
:
if(isset($_POST["item_id"]))
$query = "Update centrodb.Alertas SET Status = '0' WHERE Id = '".$_POST["item_id"]."'";
$result = mysqli_query($conn, $query);
Pata check in the td
we put like this:
width="20%" <?php echo $row["Status"] == '1'?' style="font-weight:bold" ':' style="font-weight:normal" '?>
td
complete:
<td class="td-info view_data" id="<?php echo $row["Id"]; ?>" data-toggle="modal" href="#dataModal" width="20%" <?php echo $row["Status"] == '1'?' style="font-weight:bold" ':' style="font-weight:normal" '?>><?php echo $row["Assunto"]; ?></td>
add a comment
|
Solution to achieve the condition.
I created a Status
field in the database table, where 1 is unread message and 0 message is read, now is to create the condition in td with if
. In the javascript with which I open the modal I made the following change:
$('.td-info').click(function()
var item_id = $(this).attr("id");
var status = $(this).attr("Status");
$.ajax(
url:"./fetchRAD",
method: "POST",
data:item_id:item_id, status:status,
success:function(data)
);
);
In td
I indicated the id
of the record in the id
of td
:
id="<?php echo $row["Id"]; ?>"
file with php
:
if(isset($_POST["item_id"]))
$query = "Update centrodb.Alertas SET Status = '0' WHERE Id = '".$_POST["item_id"]."'";
$result = mysqli_query($conn, $query);
Pata check in the td
we put like this:
width="20%" <?php echo $row["Status"] == '1'?' style="font-weight:bold" ':' style="font-weight:normal" '?>
td
complete:
<td class="td-info view_data" id="<?php echo $row["Id"]; ?>" data-toggle="modal" href="#dataModal" width="20%" <?php echo $row["Status"] == '1'?' style="font-weight:bold" ':' style="font-weight:normal" '?>><?php echo $row["Assunto"]; ?></td>
add a comment
|
Solution to achieve the condition.
I created a Status
field in the database table, where 1 is unread message and 0 message is read, now is to create the condition in td with if
. In the javascript with which I open the modal I made the following change:
$('.td-info').click(function()
var item_id = $(this).attr("id");
var status = $(this).attr("Status");
$.ajax(
url:"./fetchRAD",
method: "POST",
data:item_id:item_id, status:status,
success:function(data)
);
);
In td
I indicated the id
of the record in the id
of td
:
id="<?php echo $row["Id"]; ?>"
file with php
:
if(isset($_POST["item_id"]))
$query = "Update centrodb.Alertas SET Status = '0' WHERE Id = '".$_POST["item_id"]."'";
$result = mysqli_query($conn, $query);
Pata check in the td
we put like this:
width="20%" <?php echo $row["Status"] == '1'?' style="font-weight:bold" ':' style="font-weight:normal" '?>
td
complete:
<td class="td-info view_data" id="<?php echo $row["Id"]; ?>" data-toggle="modal" href="#dataModal" width="20%" <?php echo $row["Status"] == '1'?' style="font-weight:bold" ':' style="font-weight:normal" '?>><?php echo $row["Assunto"]; ?></td>
Solution to achieve the condition.
I created a Status
field in the database table, where 1 is unread message and 0 message is read, now is to create the condition in td with if
. In the javascript with which I open the modal I made the following change:
$('.td-info').click(function()
var item_id = $(this).attr("id");
var status = $(this).attr("Status");
$.ajax(
url:"./fetchRAD",
method: "POST",
data:item_id:item_id, status:status,
success:function(data)
);
);
In td
I indicated the id
of the record in the id
of td
:
id="<?php echo $row["Id"]; ?>"
file with php
:
if(isset($_POST["item_id"]))
$query = "Update centrodb.Alertas SET Status = '0' WHERE Id = '".$_POST["item_id"]."'";
$result = mysqli_query($conn, $query);
Pata check in the td
we put like this:
width="20%" <?php echo $row["Status"] == '1'?' style="font-weight:bold" ':' style="font-weight:normal" '?>
td
complete:
<td class="td-info view_data" id="<?php echo $row["Id"]; ?>" data-toggle="modal" href="#dataModal" width="20%" <?php echo $row["Status"] == '1'?' style="font-weight:bold" ':' style="font-weight:normal" '?>><?php echo $row["Assunto"]; ?></td>
edited Mar 28 at 14:10
answered Mar 28 at 12:18
Bruno PintoBruno Pinto
617 bronze badges
617 bronze badges
add a comment
|
add a comment
|
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55396047%2fafter-the-click-does-not-appear-in-bold%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Where specifically in your code do you make the text bold? On what condition do you perform that operation? Why specifically do you expect that condition to change after a message has been read?
– David
Mar 28 at 11:11
@David I do not understand, I put the td "Subject" in bold, inside the td, then when I click it is no longer in bold, but I have no condition. I want to make only the new messages in bold, to know the ones I have not read yet
– Bruno Pinto
Mar 28 at 11:17
"but I have no condition" - Sounds like you need one. "I want to make only the new messages in bold" - And it sounds like you already know what that condition is. When you're rendering this data, conditionally make the text bold based on whether or not the message has been read. How do you track that information? Once you have that information, it sounds like what you're looking for is called an
if
statement in PHP.– David
Mar 28 at 11:19
@BrunoPinto you will have to setup your messages table in database for read/unread messages, i.e. make a column read, if receiver read the message put 1 else zero, this is how you will get a read value while looping.
– Shoyeb Sheikh
Mar 28 at 11:22
@Shoyeb Sheikh I added an answer with the creation of a field in the table where I will be able to create the condition. Now how do I create the condition inside the
TD
. I'm trying like this:width="20%" style="font-weight:bold" onclick="if(<?php echo $row["Status"] == '1'; ?> )this.style['font-weight'] ='normal'"
, but it does not– Bruno Pinto
Mar 28 at 12:35