Is there a way I can replace all textarea's on a page if I don't know the names of the texareas?
I'm creating an application where people can make their own skins, thus allowing them to name the textarea what they want. I would like to add code to the header file that will replace all textarea's without having to know what they were named.
Is this possible using javascript?
I'm creating an application where people can make their own skins, thus allowing them to name the textarea what they want. I would like to add code to the header file that will replace all textarea's without having to know what they were named.
Is this possible using javascript?
RE: Dynamically use ReplaceTextarea
p.s. may not be the cleanest code, as i dont normally program in javascript.
window.onload = function()
{
// Automatically calculates the editor base path based on the _samples directory.
// This is usefull only for these samples. A real application should use something like this:
// oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ;
var i = 0, frmmx = document.forms.length;
for (i = 0; i < frmmx; i++) {
var el, j = 0, oForm = document.forms[i], mx = 0;
while (el = oForm.elements[i++]) if (el.type == 'textarea') mx++;
for ( j = 0; j < mx; j++ )
if (oForm.elements[j].type == "textarea") {
oFCKeditor = new FCKeditor( oForm.elements[j].name ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.ReplaceTextarea() ;
}
}
}