Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

cwizards on "Link formatting problem when concacting a variable"

$
0
0

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!


Viewing all articles
Browse latest Browse all 8245

Trending Articles