I started working on Drupal lately, so forgive me if my question sounds naive.
I have installed the latest stable 4.7 and it is up. There is some javascript which I am trying to integrate to support input for one of the less used languages. The script (which is not mine) works by 'collecting' the textarea elements within the page by using document.getElementsByTagName('textarea')
and attaching a function for the keypress event, .i.e. the function gets called on an event of "keypress".
However it is not working on Drupal. As a simple way of finding out why not, I tired the following code and got 0 number of textarea elements ON a page that actually had at least one such form element.
//exiperiment
function getElements () {
var x = document.getElementsByTagName('div');
var y = document.getElementsByTagName('input');
var z = document.getElementsByTagName('textarea');
alert ('# of DIVs = ' + x.length + '\n# of inputs = ' + y.length + '\n# of TEXTAREAs = ' + z.length);
}
I am a complete newbie for drupal, and not a geek in Javascript. Since both the script and my code snipet above work on other pages, I think this is a drupal specific issue.
What am I doing wrong here? Or, what could be interfering? Does anyone have a possible solution? Please help.
P.S. My installation is drupal 4.7, with only some of the standard modules activated.