Jump to content

echo to screen formatting incorrectly


cwizards

Recommended Posts

I have been trying to build a list of items with an onClick event but the link keeps on formatting incorrectly! Can anyone advise how to correct this please.
$name=$myrows->display_name; ="Fred Marshall"
echo "<UL><li><a onclick=$('#searchUsers').val('$name');>$name</a></li></ul>";
I have also tried
echo "<UL><li><a onclick=$('#searchUsers').val('" . $name . "');>$name</a></li></ul>";
with the same result :-
<a marshall');="" onclick="$('#acf-field-owner').val('16837');$('#searchUsers').val('Fred">Fred Marshall</a>
note the words Fred and Marshall are not together in the val() function!

Link to comment
https://forums.phpfreaks.com/topic/281809-echo-to-screen-formatting-incorrectly/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.