Include Jquery Parameter in Echo PHP with Row The Next CEO of Stack OverflowIs there an “exists” function for jQuery?How can I prevent SQL injection in PHP?Add table row in jQueryHow do I check if an element is hidden in jQuery?Setting “checked” for a checkbox with jQuery?How can I know which radio button is selected via jQuery?How to check whether a checkbox is checked in jQuery?Reference — What does this symbol mean in PHP?jQuery scroll to element“Thinking in AngularJS” if I have a jQuery background?
How to edit “Name” property in GCI output?
Is it okay to majorly distort historical facts while writing a fiction story?
When you upcast Blindness/Deafness, do all targets suffer the same effect?
Why does standard notation not preserve intervals (visually)
How to delete every two lines after 3rd lines in a file contains very large number of lines?
Would a completely good Muggle be able to use a wand?
Is it possible to replace duplicates of a character with one character using tr
Does increasing your ability score affect your main stat?
What connection does MS Office have to Netscape Navigator?
Is wanting to ask what to write an indication that you need to change your story?
How to get from Geneva Airport to Metabief, Doubs, France by public transport?
Why doesn't UK go for the same deal Japan has with EU to resolve Brexit?
What happened in Rome, when the western empire "fell"?
Why do airplanes bank sharply to the right after air-to-air refueling?
Yu-Gi-Oh cards in Python 3
Why didn't Khan get resurrected in the Genesis Explosion?
Is it professional to write unrelated content in an almost-empty email?
Prepend last line of stdin to entire stdin
Running a General Election and the European Elections together
Is a distribution that is normal, but highly skewed considered Gaussian?
Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?
Why do remote US companies require working in the US?
Make solar eclipses exceedingly rare, but still have new moons
Bartok - Syncopation (1): Meaning of notes in between Grand Staff
Include Jquery Parameter in Echo PHP with Row
The Next CEO of Stack OverflowIs there an “exists” function for jQuery?How can I prevent SQL injection in PHP?Add table row in jQueryHow do I check if an element is hidden in jQuery?Setting “checked” for a checkbox with jQuery?How can I know which radio button is selected via jQuery?How to check whether a checkbox is checked in jQuery?Reference — What does this symbol mean in PHP?jQuery scroll to element“Thinking in AngularJS” if I have a jQuery background?
hello ive been trying to figure this out for days now.
What i want to do is echo a test and then create a button that copies the echoed text to the clipboard.
So what i want is that i have an SQL list, in that List there is an ID row i can pass to my echo in the paragraph, but when i try to do the same with the parameter the # seems to an issue.
while($row = mysqli_fetch_array($result))
echo "<div>";
echo " <p id='" . $row['ID'] . "'>" . $row['Message'] . "</p>";
echo '<button onclick="copyToClipboard('. $row['Title'] . ')">Copy TEXT 2</button>';
echo " </div>";
Also it somehow generates the parameter but there is a blank space between
(" #om2")".
- my SQL
- ID = OM2
- Title = "#OM2"
- Message = some3ohruihrgfijbfgbrfghrgjikbnhjergbnergbg
any help is greatly appreciated
Edit.
Script
<script type="text/javascript">
function copyToClipboard(element)
var $temp = $("<textarea>");
$("body").append($temp);
var html = $(element).html();
html = html.replace(/<br>/g, "n"); // or rn
console.log(html);
$temp.val(html).select();
document.execCommand("copy");
$temp.remove();
</script>
with echo '<button onclick="copyToClipboard(' . $row['Title'] . ')>Copy TEXT 2</button>';
Image!!!
php jquery html sql
|
show 4 more comments
hello ive been trying to figure this out for days now.
What i want to do is echo a test and then create a button that copies the echoed text to the clipboard.
So what i want is that i have an SQL list, in that List there is an ID row i can pass to my echo in the paragraph, but when i try to do the same with the parameter the # seems to an issue.
while($row = mysqli_fetch_array($result))
echo "<div>";
echo " <p id='" . $row['ID'] . "'>" . $row['Message'] . "</p>";
echo '<button onclick="copyToClipboard('. $row['Title'] . ')">Copy TEXT 2</button>';
echo " </div>";
Also it somehow generates the parameter but there is a blank space between
(" #om2")".
- my SQL
- ID = OM2
- Title = "#OM2"
- Message = some3ohruihrgfijbfgbrfghrgjikbnhjergbnergbg
any help is greatly appreciated
Edit.
Script
<script type="text/javascript">
function copyToClipboard(element)
var $temp = $("<textarea>");
$("body").append($temp);
var html = $(element).html();
html = html.replace(/<br>/g, "n"); // or rn
console.log(html);
$temp.val(html).select();
document.execCommand("copy");
$temp.remove();
</script>
with echo '<button onclick="copyToClipboard(' . $row['Title'] . ')>Copy TEXT 2</button>';
Image!!!
php jquery html sql
1
You can use trim() to eliminate whitespaces..
– Vidal
Mar 7 at 16:56
i tried in on after the echo and before the row started, tried on the row it self. Same issue
– Carlos Reyes
Mar 7 at 16:59
trim($row['Title']) ? can we see your copyToClipboard javascript function ?
– Vidal
Mar 7 at 16:59
added it on edit.
– Carlos Reyes
Mar 7 at 17:03
1
Maybe it's quote problem, I think you would like to have the param as a string?: echo '<button onclick="copyToClipboard("' . $row['Title'] . '")">Copy TEXT 2</button>';
– arvie
Mar 7 at 17:06
|
show 4 more comments
hello ive been trying to figure this out for days now.
What i want to do is echo a test and then create a button that copies the echoed text to the clipboard.
So what i want is that i have an SQL list, in that List there is an ID row i can pass to my echo in the paragraph, but when i try to do the same with the parameter the # seems to an issue.
while($row = mysqli_fetch_array($result))
echo "<div>";
echo " <p id='" . $row['ID'] . "'>" . $row['Message'] . "</p>";
echo '<button onclick="copyToClipboard('. $row['Title'] . ')">Copy TEXT 2</button>';
echo " </div>";
Also it somehow generates the parameter but there is a blank space between
(" #om2")".
- my SQL
- ID = OM2
- Title = "#OM2"
- Message = some3ohruihrgfijbfgbrfghrgjikbnhjergbnergbg
any help is greatly appreciated
Edit.
Script
<script type="text/javascript">
function copyToClipboard(element)
var $temp = $("<textarea>");
$("body").append($temp);
var html = $(element).html();
html = html.replace(/<br>/g, "n"); // or rn
console.log(html);
$temp.val(html).select();
document.execCommand("copy");
$temp.remove();
</script>
with echo '<button onclick="copyToClipboard(' . $row['Title'] . ')>Copy TEXT 2</button>';
Image!!!
php jquery html sql
hello ive been trying to figure this out for days now.
What i want to do is echo a test and then create a button that copies the echoed text to the clipboard.
So what i want is that i have an SQL list, in that List there is an ID row i can pass to my echo in the paragraph, but when i try to do the same with the parameter the # seems to an issue.
while($row = mysqli_fetch_array($result))
echo "<div>";
echo " <p id='" . $row['ID'] . "'>" . $row['Message'] . "</p>";
echo '<button onclick="copyToClipboard('. $row['Title'] . ')">Copy TEXT 2</button>';
echo " </div>";
Also it somehow generates the parameter but there is a blank space between
(" #om2")".
- my SQL
- ID = OM2
- Title = "#OM2"
- Message = some3ohruihrgfijbfgbrfghrgjikbnhjergbnergbg
any help is greatly appreciated
Edit.
Script
<script type="text/javascript">
function copyToClipboard(element)
var $temp = $("<textarea>");
$("body").append($temp);
var html = $(element).html();
html = html.replace(/<br>/g, "n"); // or rn
console.log(html);
$temp.val(html).select();
document.execCommand("copy");
$temp.remove();
</script>
with echo '<button onclick="copyToClipboard(' . $row['Title'] . ')>Copy TEXT 2</button>';
Image!!!
php jquery html sql
php jquery html sql
edited Mar 7 at 17:17
Carlos Reyes
asked Mar 7 at 16:52
Carlos ReyesCarlos Reyes
32
32
1
You can use trim() to eliminate whitespaces..
– Vidal
Mar 7 at 16:56
i tried in on after the echo and before the row started, tried on the row it self. Same issue
– Carlos Reyes
Mar 7 at 16:59
trim($row['Title']) ? can we see your copyToClipboard javascript function ?
– Vidal
Mar 7 at 16:59
added it on edit.
– Carlos Reyes
Mar 7 at 17:03
1
Maybe it's quote problem, I think you would like to have the param as a string?: echo '<button onclick="copyToClipboard("' . $row['Title'] . '")">Copy TEXT 2</button>';
– arvie
Mar 7 at 17:06
|
show 4 more comments
1
You can use trim() to eliminate whitespaces..
– Vidal
Mar 7 at 16:56
i tried in on after the echo and before the row started, tried on the row it self. Same issue
– Carlos Reyes
Mar 7 at 16:59
trim($row['Title']) ? can we see your copyToClipboard javascript function ?
– Vidal
Mar 7 at 16:59
added it on edit.
– Carlos Reyes
Mar 7 at 17:03
1
Maybe it's quote problem, I think you would like to have the param as a string?: echo '<button onclick="copyToClipboard("' . $row['Title'] . '")">Copy TEXT 2</button>';
– arvie
Mar 7 at 17:06
1
1
You can use trim() to eliminate whitespaces..
– Vidal
Mar 7 at 16:56
You can use trim() to eliminate whitespaces..
– Vidal
Mar 7 at 16:56
i tried in on after the echo and before the row started, tried on the row it self. Same issue
– Carlos Reyes
Mar 7 at 16:59
i tried in on after the echo and before the row started, tried on the row it self. Same issue
– Carlos Reyes
Mar 7 at 16:59
trim($row['Title']) ? can we see your copyToClipboard javascript function ?
– Vidal
Mar 7 at 16:59
trim($row['Title']) ? can we see your copyToClipboard javascript function ?
– Vidal
Mar 7 at 16:59
added it on edit.
– Carlos Reyes
Mar 7 at 17:03
added it on edit.
– Carlos Reyes
Mar 7 at 17:03
1
1
Maybe it's quote problem, I think you would like to have the param as a string?: echo '<button onclick="copyToClipboard("' . $row['Title'] . '")">Copy TEXT 2</button>';
– arvie
Mar 7 at 17:06
Maybe it's quote problem, I think you would like to have the param as a string?: echo '<button onclick="copyToClipboard("' . $row['Title'] . '")">Copy TEXT 2</button>';
– arvie
Mar 7 at 17:06
|
show 4 more comments
1 Answer
1
active
oldest
votes
You are trying to pass #OM2
as agument of the copyToClipboard()
function...
There are some quotes missing to make it a string. Actually, #OM2
isn't.
Try to add some '
:
echo '<button onclick="copyToClipboard(''. $row['Title'] . '')">Copy TEXT 2</button>';
That should work... But I would suggest a better alternative...
Use a class handle the click event, instead of an inline onclick
.
while($row = mysqli_fetch_array($result))
echo "<div>";
echo " <p id='" . $row['ID'] . "'>" . $row['Message'] . "</p>";
echo '<button class="copy">Copy TEXT 2</button>';
echo " </div>";
Then your clipboard copy script would simply be:
$(".copy").on("click",function()
var text = $(this).prev("p").html().replace(/<br>/g, "n");
navigator.clipboard.writeText(text);
);
Here is a snippet ;)
$(".copy").on("click",function()
var text = $(this).prev("p").html().replace(/<br>/g, "n");
navigator.clipboard.writeText(text);
);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div>
<p id="OM2">some3ohruihrgfijbfgbrfghrgjikbnhjergbnergbg</p>
<button class="copy">Copy TEXT 2</button>
</div>
Tried it, and nothing happens. click the button but it not copying it to the clipboard
– Carlos Reyes
Mar 7 at 17:27
(?) Works on my side...
– Louys Patrice Bessette
Mar 7 at 17:28
1
@CarlosReyes You may need to wrap the JS provided in the infamous$(document).ready(function() {
wrapper.
– Scoots
Mar 7 at 17:28
Holy jesus!!! WAIT Moved my script below >.> the php tags seems to work
– Carlos Reyes
Mar 7 at 17:29
Working NICE, thank you very much!!!!
– Carlos Reyes
Mar 7 at 17:32
|
show 1 more 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/3.0/"u003ecc by-sa 3.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%2f55049035%2finclude-jquery-parameter-in-echo-php-with-row%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
You are trying to pass #OM2
as agument of the copyToClipboard()
function...
There are some quotes missing to make it a string. Actually, #OM2
isn't.
Try to add some '
:
echo '<button onclick="copyToClipboard(''. $row['Title'] . '')">Copy TEXT 2</button>';
That should work... But I would suggest a better alternative...
Use a class handle the click event, instead of an inline onclick
.
while($row = mysqli_fetch_array($result))
echo "<div>";
echo " <p id='" . $row['ID'] . "'>" . $row['Message'] . "</p>";
echo '<button class="copy">Copy TEXT 2</button>';
echo " </div>";
Then your clipboard copy script would simply be:
$(".copy").on("click",function()
var text = $(this).prev("p").html().replace(/<br>/g, "n");
navigator.clipboard.writeText(text);
);
Here is a snippet ;)
$(".copy").on("click",function()
var text = $(this).prev("p").html().replace(/<br>/g, "n");
navigator.clipboard.writeText(text);
);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div>
<p id="OM2">some3ohruihrgfijbfgbrfghrgjikbnhjergbnergbg</p>
<button class="copy">Copy TEXT 2</button>
</div>
Tried it, and nothing happens. click the button but it not copying it to the clipboard
– Carlos Reyes
Mar 7 at 17:27
(?) Works on my side...
– Louys Patrice Bessette
Mar 7 at 17:28
1
@CarlosReyes You may need to wrap the JS provided in the infamous$(document).ready(function() {
wrapper.
– Scoots
Mar 7 at 17:28
Holy jesus!!! WAIT Moved my script below >.> the php tags seems to work
– Carlos Reyes
Mar 7 at 17:29
Working NICE, thank you very much!!!!
– Carlos Reyes
Mar 7 at 17:32
|
show 1 more comment
You are trying to pass #OM2
as agument of the copyToClipboard()
function...
There are some quotes missing to make it a string. Actually, #OM2
isn't.
Try to add some '
:
echo '<button onclick="copyToClipboard(''. $row['Title'] . '')">Copy TEXT 2</button>';
That should work... But I would suggest a better alternative...
Use a class handle the click event, instead of an inline onclick
.
while($row = mysqli_fetch_array($result))
echo "<div>";
echo " <p id='" . $row['ID'] . "'>" . $row['Message'] . "</p>";
echo '<button class="copy">Copy TEXT 2</button>';
echo " </div>";
Then your clipboard copy script would simply be:
$(".copy").on("click",function()
var text = $(this).prev("p").html().replace(/<br>/g, "n");
navigator.clipboard.writeText(text);
);
Here is a snippet ;)
$(".copy").on("click",function()
var text = $(this).prev("p").html().replace(/<br>/g, "n");
navigator.clipboard.writeText(text);
);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div>
<p id="OM2">some3ohruihrgfijbfgbrfghrgjikbnhjergbnergbg</p>
<button class="copy">Copy TEXT 2</button>
</div>
Tried it, and nothing happens. click the button but it not copying it to the clipboard
– Carlos Reyes
Mar 7 at 17:27
(?) Works on my side...
– Louys Patrice Bessette
Mar 7 at 17:28
1
@CarlosReyes You may need to wrap the JS provided in the infamous$(document).ready(function() {
wrapper.
– Scoots
Mar 7 at 17:28
Holy jesus!!! WAIT Moved my script below >.> the php tags seems to work
– Carlos Reyes
Mar 7 at 17:29
Working NICE, thank you very much!!!!
– Carlos Reyes
Mar 7 at 17:32
|
show 1 more comment
You are trying to pass #OM2
as agument of the copyToClipboard()
function...
There are some quotes missing to make it a string. Actually, #OM2
isn't.
Try to add some '
:
echo '<button onclick="copyToClipboard(''. $row['Title'] . '')">Copy TEXT 2</button>';
That should work... But I would suggest a better alternative...
Use a class handle the click event, instead of an inline onclick
.
while($row = mysqli_fetch_array($result))
echo "<div>";
echo " <p id='" . $row['ID'] . "'>" . $row['Message'] . "</p>";
echo '<button class="copy">Copy TEXT 2</button>';
echo " </div>";
Then your clipboard copy script would simply be:
$(".copy").on("click",function()
var text = $(this).prev("p").html().replace(/<br>/g, "n");
navigator.clipboard.writeText(text);
);
Here is a snippet ;)
$(".copy").on("click",function()
var text = $(this).prev("p").html().replace(/<br>/g, "n");
navigator.clipboard.writeText(text);
);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div>
<p id="OM2">some3ohruihrgfijbfgbrfghrgjikbnhjergbnergbg</p>
<button class="copy">Copy TEXT 2</button>
</div>
You are trying to pass #OM2
as agument of the copyToClipboard()
function...
There are some quotes missing to make it a string. Actually, #OM2
isn't.
Try to add some '
:
echo '<button onclick="copyToClipboard(''. $row['Title'] . '')">Copy TEXT 2</button>';
That should work... But I would suggest a better alternative...
Use a class handle the click event, instead of an inline onclick
.
while($row = mysqli_fetch_array($result))
echo "<div>";
echo " <p id='" . $row['ID'] . "'>" . $row['Message'] . "</p>";
echo '<button class="copy">Copy TEXT 2</button>';
echo " </div>";
Then your clipboard copy script would simply be:
$(".copy").on("click",function()
var text = $(this).prev("p").html().replace(/<br>/g, "n");
navigator.clipboard.writeText(text);
);
Here is a snippet ;)
$(".copy").on("click",function()
var text = $(this).prev("p").html().replace(/<br>/g, "n");
navigator.clipboard.writeText(text);
);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div>
<p id="OM2">some3ohruihrgfijbfgbrfghrgjikbnhjergbnergbg</p>
<button class="copy">Copy TEXT 2</button>
</div>
$(".copy").on("click",function()
var text = $(this).prev("p").html().replace(/<br>/g, "n");
navigator.clipboard.writeText(text);
);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div>
<p id="OM2">some3ohruihrgfijbfgbrfghrgjikbnhjergbnergbg</p>
<button class="copy">Copy TEXT 2</button>
</div>
$(".copy").on("click",function()
var text = $(this).prev("p").html().replace(/<br>/g, "n");
navigator.clipboard.writeText(text);
);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div>
<p id="OM2">some3ohruihrgfijbfgbrfghrgjikbnhjergbnergbg</p>
<button class="copy">Copy TEXT 2</button>
</div>
edited Mar 7 at 17:24
answered Mar 7 at 17:16
Louys Patrice BessetteLouys Patrice Bessette
20.4k42345
20.4k42345
Tried it, and nothing happens. click the button but it not copying it to the clipboard
– Carlos Reyes
Mar 7 at 17:27
(?) Works on my side...
– Louys Patrice Bessette
Mar 7 at 17:28
1
@CarlosReyes You may need to wrap the JS provided in the infamous$(document).ready(function() {
wrapper.
– Scoots
Mar 7 at 17:28
Holy jesus!!! WAIT Moved my script below >.> the php tags seems to work
– Carlos Reyes
Mar 7 at 17:29
Working NICE, thank you very much!!!!
– Carlos Reyes
Mar 7 at 17:32
|
show 1 more comment
Tried it, and nothing happens. click the button but it not copying it to the clipboard
– Carlos Reyes
Mar 7 at 17:27
(?) Works on my side...
– Louys Patrice Bessette
Mar 7 at 17:28
1
@CarlosReyes You may need to wrap the JS provided in the infamous$(document).ready(function() {
wrapper.
– Scoots
Mar 7 at 17:28
Holy jesus!!! WAIT Moved my script below >.> the php tags seems to work
– Carlos Reyes
Mar 7 at 17:29
Working NICE, thank you very much!!!!
– Carlos Reyes
Mar 7 at 17:32
Tried it, and nothing happens. click the button but it not copying it to the clipboard
– Carlos Reyes
Mar 7 at 17:27
Tried it, and nothing happens. click the button but it not copying it to the clipboard
– Carlos Reyes
Mar 7 at 17:27
(?) Works on my side...
– Louys Patrice Bessette
Mar 7 at 17:28
(?) Works on my side...
– Louys Patrice Bessette
Mar 7 at 17:28
1
1
@CarlosReyes You may need to wrap the JS provided in the infamous
$(document).ready(function() {
wrapper.– Scoots
Mar 7 at 17:28
@CarlosReyes You may need to wrap the JS provided in the infamous
$(document).ready(function() {
wrapper.– Scoots
Mar 7 at 17:28
Holy jesus!!! WAIT Moved my script below >.> the php tags seems to work
– Carlos Reyes
Mar 7 at 17:29
Holy jesus!!! WAIT Moved my script below >.> the php tags seems to work
– Carlos Reyes
Mar 7 at 17:29
Working NICE, thank you very much!!!!
– Carlos Reyes
Mar 7 at 17:32
Working NICE, thank you very much!!!!
– Carlos Reyes
Mar 7 at 17:32
|
show 1 more comment
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%2f55049035%2finclude-jquery-parameter-in-echo-php-with-row%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
You can use trim() to eliminate whitespaces..
– Vidal
Mar 7 at 16:56
i tried in on after the echo and before the row started, tried on the row it self. Same issue
– Carlos Reyes
Mar 7 at 16:59
trim($row['Title']) ? can we see your copyToClipboard javascript function ?
– Vidal
Mar 7 at 16:59
added it on edit.
– Carlos Reyes
Mar 7 at 17:03
1
Maybe it's quote problem, I think you would like to have the param as a string?: echo '<button onclick="copyToClipboard("' . $row['Title'] . '")">Copy TEXT 2</button>';
– arvie
Mar 7 at 17:06