Code:
function updateTextarea(textareaName, fieldName){
var currentValue = document.getElementById(textareaName).value;
var currentName = document.getElementById(fieldName).value;
var replacer = "[yourname]";
var newValue = currentValue.replace(replacer, currentName);
// replacer = currentName;
document.getElementById(textareaName).value = newValue;
// make the fields inactive now
document.getElementById(fieldName).disabled = true;
document.getElementById("setButton").disabled = true;
}
what i want to do is this: i have a textarea called "message" and a input field called "name" with a button next to it called "setButton" which you click on, and it replaces the instance of "[yourname] in the "message" textarea with the value of the "name" text field, and then proceeds to make the "name" and "setButton" elements disabled so you can't replace again.
my problem is that this works exactly how i want it to in IE, but neither parts of the functionality work in firefox (haven't tried Opera or safari yet)
any help?