如何将对象的属性设置为变量?该变量等于表单文本字段值。两者obj.property并在我显示对象时obj[property]给我一个。undefined errormycar
function auto(manufacturer,model,engine_size,year,color,price) 
{
    this.manufacturer = manufacturer;
    this.model = model;
    this.engine_size = engine_size;
    this.year = year;
    this.color = color;
    this.price = price;
}
var mycar = new auto();
var a = document.form.num1.value;
mycar.manufacturer = a;
mycar[manufacturer] = a;
对不起。这是我所有的代码http://jsfiddle.net/vzqjv/
我试图将我的对象属性设置为一个变量 a,它在经过一些验证后等于表单文本字段值,以查看它是否签出。