I'm using the following code in php:
PHP:
$suggested_sentence[0] = "Hello, how are you?";
echo $suggested_sentence[0] . ' <input type="image" src="button.png"
onclick = update_textarea('. $textareacount.','. "'".$suggested_sentence[0]."')/>";
Javascript function:
function update_textarea(count, new_sentence) {
document.getElementById('sentence' + count).value = new_sentence;
}
But when i press the button i get the error "unterminated string literal but if i change the value of $suggested_sentence[0] = "Hello" it works fine.
What should i do then?