日期:2014-05-16  浏览次数:20391 次

js中对数组的一些处理
function fOnChange(pobjThis, pstrBuyId) {                
                itemCodeSet(pstrBuyId);               
		if (eval("document.f2.SellChk_" + String(pstrBuyId)).checked == false) {
			if (fSelectCount() >= 100) {
				alert("選択が100件を超えています。" + fSelectCount() + "件");
				pobjThis.focus();
				return false;
			}
		}
		eval("document.f2.SellChk_" + String(pstrBuyId)).checked = true;
		//eval("document.f2.SellChk_" + String(pstrBuyId)).disabled = false;
		//eval("document.f2.SellChk_" + String(pstrBuyId)).style.display = "inline";
		//eval("document.f2.SellImg_" + String(pstrBuyId)).style.display = "none";

		if (pobjThis) {
			if (pobjThis.name == ("subject_code_" + pstrBuyId)) {
				if (eval("document.f2.subject_code_" + pstrBuyId).value != eval("document.f2.ck_subject_code_"
						+ pstrBuyId).value) {
					eval("document.f2.subject_code2_" + pstrBuyId).value = "";
					eval("document.f2.subject_small_id_" + pstrBuyId).value = "";
					eval("document.f2.subject_small_name_" + pstrBuyId).value = "";
					eval("document.getElementById('subject_name_" + pstrBuyId + "')").innerHTML = "";
					eval("document.f2.subject_small_name2_" + pstrBuyId).value = "";
					eval("document.getElementById('subject_name2_" + pstrBuyId + "')").innerHTML = "";
					eval("document.f2.ck_subject_code_" + pstrBuyId).value = eval("document.f2.subject_code_"
							+ pstrBuyId).value;
				}
			} else if (pobjThis.name == ("subject_code2_" + pstrBuyId)) {
				if (eval("document.f2.subject_code2_" + pstrBuyId).value != eval("document.f2.ck_subject_code2_"
						+ pstrBuyId).value) {
					eval("document.f2.subject_small_id_" + pstrBuyId).value = "";
					eval("document.f2.subject_small_name_" + pstrBuyId).value = "";
					eval("document.getElementById('subject_name_" + pstrBuyId + "')").innerHTML = "";
					eval("document.f2.subject_small_name2_" + pstrBuyId).value = "";
					eval("document.getElementById('subject_name2_" + pstrBuyId + "')").innerHTML = "";
					eval("document.f2.ck_subject_code2_" + pstrBuyId).value = eval("document.f2.subject_code2_"
							+ pstrBuyId).value;
				}
			} else if (pobjThis.name == ("subject_code_a_" + pstrBuyId)) {
				if (eval("document.f2.subject_code_a_" + pstrBuyId).value != eval("document.f2.ck_subject_code_a_"
						+ pstrBuyId).value) {
					eval("document.f2.subject_code_a2_" + pstrBuyId).value = "";
					eval("document.f2.subject_small_id_a_" + pstrBuyId).value = "";
					eval("document.f2.subject_small_name_a_" + pstrBuyId).value = "";
					eval("document.getElementById('subject_name_a_" + pstrBuyId + "')").innerHTML = "";
					eval("document.f2.subject_small_name_a2_" + pstrBuyId).value = "";
					eval("document.getElementById('subject_name_a2_" + pstrBuyId + "')").innerHTML = "";
					eval("document.f2.ck_subject_code_a_" + pstrBuyId).value = eval("document.f2.subject_code_a_"
							+ pstrBuyId).value;
				}
			} else if (pobjThis.name == ("subject_code_a2_" + pstrBuyId)) {
				if (eval("document.f2.subject_code_a2_" + pstrBuyId).value != eval("document.f2.ck_subject_code_a2_"
						+ pstrBuyId).value) {
					eval("document.f2.subject_small_id_a_" + pstrBuyId).value = "";
					eval("document.f2.subject_small_name_a_" + pstrBuyId).value = "";
					eval("document.getElementById('subject_name_a_" + pstrBuyId + "')").innerHTML = "";
					eval("document.f2.subject_small_name_a2_" + pstrBuyId).value = "";
					eval("document.getElementById('subject_name_a2_" + pstrBuyId + "')").innerHTML = "";
					eval("document.f2.ck_subject_code_a2_" + pstrBuyId).value = eval("document.f2.subject_code_a2_"
							+ pstrBuyId).value;
				}
			}
		}

		fDataSet(pstrBuyId);

		if (fDataInitialCheck(pstrBuyId)) {
			//初期内容に戻る
			fDataDelete(pstrBuyId);
		}
        if (eval("document.f2.SellChk_" + String(pstrBuyId)).checked == true) {
            $("input[name=SellChk_" + String(pstrBuyId) + "]").parents("tr:f