I have a form called frmProfile, a textarea called article and a button with an onclick event set to addtext(this.form)
I have this function:
Code: Select all
addtext(form){
}Code: Select all
var Article = form.article.value;The problem is this, i want to use this code for multiple forms on different pages, however all my text areas have different names. Now i was wondering is there anyway to add a variable to the js code so that it's easy to change all the times i refer to form.article.value?
I tried using var textareaName = "article"; and then i could change it on each of my pages and change the js code to something like:
Code: Select all
var Article = form.textareaName.value;Thanks
sorry about the title wasn't sure of how to describe my problem

