I am trying to set values of dynamically generated fields using eval() function in javascript.Since I don't know the name of the field beforehand.
Here is what I have done.
here last two parameters are the name of the fields whose values I want to set. and the first two values are the values which I want to set them to.
function onRefreshTypes(fuelType,startType,fuelTypes,startTypes)
{
var fuelTypes1=fuelTypes;
var startTypes1=startTypes;
eval("document.frm."+fuelTypes1+".value="+fuelType);//here is where I am getting error
eval("document.frm."+startTypes1+".value="+startType);//here is where I am getting error
}
here frm is the name of the form in which the fields are generated I am getting an error "Unexpected identifier" where am I going wrong?