php - How to append characters to the parent window's component -
i have link, when clicks, opens window of browser (specialchars.php)
function popup_specialchars() { var ht; if(window.navigator.appversion.indexof("msie 5.01") == -1) ht = 300; else ht = 720; specialcharswindow = window.open ( "/tradesciencejournalsystem/specialchars.php", "special_characters", "resizable=yes,scrollbars=yes,height=" + ht + ",width=650,dependent=yes,alwaysraised=yes" ); specialcharswindow.focus(); } <a href="javascript:popup_specialchars();" class="special">insert special character</a> <textarea name="docarticletitle" cols="60" rows="14"></textarea>
specialchars.php
function insert_text(str) { alert(str); opener.append(str); // not working this.window.focus(); } <table border="1" id="table1" width="97%"> <tr> <td align="center" class="specialcharlink"><a href="javascript:insert_text('á')"><span class="specialchar">á</span></a></td> </tr> </table>
now happens when link of special character clicks, insert_text() called.and alert shows special character.but want append character textarea of opener window.but not working.
how can denote textarea of opener window?
gave id textarea
<textarea name="docarticletitle" id="id1" cols="60" rows="14"></textarea>
and changed
function insert_text(str) { window.opener.document.getelementbyid('id1').value += str; this.window.focus(); }
and start appending characters textarea.