PDA

View Full Version : replacing content area (id) through external javascript


iranthavan
12-17-2006, 10:52 AM
Hello People,

I am in the midst of implementing a dual language editing capability for the reply / new thread edit textareas.

a simple demo of wat i wanna achieve is here http://arunn.cjb.net/ta/index.php I just wanna impleent this in Vbulletin.

i implement by adding a button near the "Preview post" which opens the dual editor as a popup. The mission is to get the contents of the textarea >> {$editorid}_textarea
Then the user can type in the contents using the javascript based editor . the editor should return the contents back to the {$editorid}_textarea . Unfortunately this is where i got struck. Please have a look at the button code i have used.



<input onclick="win = window.open('','MyEditor','toolbar=0,menubar=0,loc ation=0,width=550,height=500');win.document.write( '&lt;script language=\'javascript\'&gt;var id=\'{$editorid}_textarea\';&lt;/script&gt;&lt;script src=\'http://arunn.cjb.net/ta/tamilpop.js\' language=javascript&gt;&lt;/script&gt;');win.focus();" type="button" value="View Tamil Editor" />

Please let me know, where is the problem. I guess the id tag of the textarea is wrong. I hear tat it can be either _textarea / _iframe . Should i change any parameters in the clientscript/vbulletin_textedit.js file ??

Please Help me out. Thanks for helping.



Also, if there is a way to replace the text box with my dual language editor, while retaining the other features.. plz let me know..