I’m trying to echo a js function in HTML string inside PHP echo.
And I can’t figure it out :
$MY_JS_FUNCTION = '<script type="text/javascript">item + getLastField2()</script>';
if($row2->type == 'text') {
echo "<li id='item-".$row2->rank."' class='list_item'>";
echo "<textarea rows='2' id='".$row2->single_id."' cols='90' name='field[".$MY_JS_FUNCTION."]' data-kind='text' >".$row2->content."</textarea>";
echo "</li>";
echo '<br />';
}
Any ideas to get this work? I think I have so much quotes in it or something like that…
Any help would be very very appreciated, thanks!
I’d reccommend storing the name in the database as well.
Then you can use $row2->name to insert the right name