When the image is clicked, it calls the addSmileyToTextBox() javascript function, passing the string 'aggressive'. The function is as follows:
function addSmileyToTextBox(smileyName)
{
var smiley = smileyName.toString();
var txt = document.getElementById("txtQuickComment");
alert(txt);
}
The function above alerts "null". Is this to say the textbox does not exist? Strange. What i wish to do is to modify the function to append a string to the textbox's contents.
getElementById will return null if the HTML node was not found, check the source and make sure you really have an element with that id. Maybe .NET adds something to the id? JSF does.
You are passing a String to the function, so why call a toString method on it?
Bookmarks