I am trying to append text from different fields on the form to hidden fields in the form. The form fields I am combining in javascript and setting them to the variable descr.
I want to append descr to a field on the form. The field(QuestionDescription) is in the form more than once so Javascript reads it as an array.
Here is the code that I am working with. I am unable to append descr when the form is submitted. Only the existing value of the array is being passed. Any help would be appreciated.
-Tim
function blah(f){
var descr = f.Description1.value + ' ' + f.Description2.value;
for(var i=0; i < f.QuestionDescription.length; i++)
{
if(i==0)
{
QuestionDescription = f.QuestionDescription.value;
}
else
{
QuestionDescription = QuestionDescription + ','+ f.QuestionDescription.value;
}
}
//QuestionDescription now holds the values of the formfield
//I am trying to append a new line to it with the following:
f.QuestionDescription.value = QuestionDescription + ',' + descr;
alert(f.QuestionDescription.value);
}
I want to append descr to a field on the form. The field(QuestionDescription) is in the form more than once so Javascript reads it as an array.
Here is the code that I am working with. I am unable to append descr when the form is submitted. Only the existing value of the array is being passed. Any help would be appreciated.
-Tim
function blah(f){
var descr = f.Description1.value + ' ' + f.Description2.value;
for(var i=0; i < f.QuestionDescription.length; i++)
{
if(i==0)
{
QuestionDescription = f.QuestionDescription.value;
}
else
{
QuestionDescription = QuestionDescription + ','+ f.QuestionDescription.value;
}
}
//QuestionDescription now holds the values of the formfield
//I am trying to append a new line to it with the following:
f.QuestionDescription.value = QuestionDescription + ',' + descr;
alert(f.QuestionDescription.value);
}