我想要做的是在for()
. 现在它看起来像这样,但据我所知,你不能从这样的变量运行命令,我不能运行, (eg) cab_type_value = "whatever"
。我也不能跑road_load_enabled
;它只是行不通。有谁可以做到这一点?如何解析我的J
var document.MyForm.InputName.disabled
?
for( var j=1; j<=14; j++ ) {
var cab_type_value = "document.exe_mode_form.cab_type" + j + ".value";
var cab_type_checked = "document.exe_mode_form.cab_type" + j + ".checked == 1";
for( var i=1; i<=document.exe_mode_form.road_load_number.value; i++ ) {
var road_load_value = "document.exe_mode_form.load" + i + ".value";
var road_load_enabled = "document.exe_mode_form.load" + i + ".disabled = false";
var road_load_disabled = "document.exe_mode_form.load" + i + ".disabled = true";
var rld_db = "document.exe_mode_form.a" + i + "_a1.value";
if ( cab_type_checked ) {
if ( test == 1 ) {
if(road_load_disabled) {
alert("road_load_disabled");
road_load_enabled;
}
test = 2;
}
if(cab_type_value == rld_db) {
if(olof == 1) {
alert("cab_type_value == rld_db");
olof = 2;
}
road_load_enabled;
}
}
}
}
此外,这部分不起作用:
if(cab_type_value == rld_db) {
if(olof == 1){
alert("cab_type_value == rld_db");
olof = 2;
}
road_load_enabled;
}
我已经检查过,与 .cab_type_value
具有相同的值rld_db
。