shubham sharma
shubham sharma

Reputation: 301

Tooltip text not working properly

I am using tooltip inside of an echo statement i.e.

echo "<div id='image' data-toggle='tooltip' title=".$row['displayname'].">"; 

but it only displays the first word.

suppose the $row['displayname'] returns "here is the code" then on hover it only displays "here".

So any help Thankyou..

Upvotes: 2

Views: 175

Answers (3)

Ivin Raj
Ivin Raj

Reputation: 3429

I am not sure this will work, but I think it would:

echo "<div id='image' data-toggle='tooltip' title='".$row['displayname']."'>"; 

Upvotes: 1

Vishnu
Vishnu

Reputation: 12293

If you don't add the quotes, it will take single word as title.

echo "<div id='image' data-toggle='tooltip' title='".$row['displayname']."'>";

or

echo "<div id='image' data-toggle='tooltip' title=\"".$row['displayname']."\">";

Upvotes: 2

kurt
kurt

Reputation: 1156

Try wrapping your title in '' quotes.

echo "<div id='image' data-toggle='tooltip' title='".$row['displayname']."'>"; 

Upvotes: 4

Related Questions