Reputation: 2197
Could someone please let me know the mistake I have done here..
echo '<button onclick="document.getElementById("."formInner".").innerHTML= document.getElementById("."SaveTheForm".").innerHTML" type="button">Edit the Table</button>';
echo '<textarea id="formInner"></textarea>';
SaveTheForm is an id of a form.
Upvotes: 0
Views: 111
Reputation: 798
Just try this
echo '<form id="SaveTheForm">';
echo '<button onclick="document.getElementById(\'formInner\').innerHTML=document.getElementById(\'SaveTheForm\').innerHTML" type="button">Edit the Table</button>';
echo '<textarea id="formInner"></textarea>';
echo '</form>';
Thanks
Upvotes: 2
Reputation: 2104
onclick="document.getElementById(\'formInner\').innerHTML= document.getElementById(\'SaveTheForm\').innerHTML"
sry changed. u need to escape the quotes
Upvotes: 1
Reputation: 787
check your javascript code,
document.getElementById("."formInner".")
should be
document.getElementById('formInner') // no dots
btw: everytime is better have javascript separate in .js files
Upvotes: 0