I am trying to join three languages with no luck.
I need to call javascript function to add clicked text to textarea, which is inside php with html.
This is what I tried as my best with no luck:
$hint .= "<br>" . "<a href='#' onclick='addtext(". $name .")'> " . $name . " </a> ";
I think I need somehow to echo that $name inside addtext() function, but don't know how, because I can't write statement inside another. I think so, because when I debug code, I see that this is recognized not as string but as attribute property:
JS function:
function addtext(str) {
var newtext = str;
document.getElementById("msg").value += newtext;
}
Please suggest a working solution to this problem.
" . " " . $name . " "; Kokių dokumentų reikia gamybinei praktikai atlikti? – Neone Nov 14 '14 at 13:54