0
내 선택 상자를위한 자바 스크립트 기능을 가지고,하지만 난 그것에 RUNAT = "서버", 다음이 줄의 스크립트 디버거 하이라이트 포함 후 :RUNAT = "서버"+ 자바 스크립트
'for (i = 0; i < sourceTo.options.length; i++) {
을'하고 말한다 :
SCRIPT5007 : 재산 '길이'의 값을 가져올 수 없습니다 : 나는 뒤에 코드에서 통해 루프를 원하고, 감사를 조언하십시오 다른 거즈를 수행하기 때문에 나는 그것을 포함
객체가 null 또는 정의되지!
코드 :
<select multiple size="8" style="width: 135px" runat="server" id="outletFromBox">
<option value="JP">Jurong Point</option>
<option value="IMM">IMM</option>
<option value="Wisma">Wisma</option>
</select>
</td>
<td align="center" valign="middle">
<input type="button" class="ui-icon ui-icon-arrowthick-1-e ui-corner-all" style="width: 20px; height: 23px;" onClick=" javascript:move(('outletFromBox'),('outletToBox')); "
value=""><br />
<input type="button" class="ui-icon ui-icon-arrowthick-1-w ui-corner-all" style="width: 20px; height: 23px;" onClick=" javascript:move(('outletToBox'),('outletFromBox')); "
value="">
</td>
<td style="padding-left: 4px">
<select multiple size="8" style="width: 135px" runat="server" onBlur="selectAll(this, true, document.getElementById('<%=uilblDestinationQualOutlet.ClientID%>'))" id="outletToBox">
</select> <span class="guide"></span>
</td></tr></table>
</div>
</asp:Panel>
자바 스크립트 : 어떤 컨트롤로 제어 변경의 클라이언트 ID를 RUNAT = "서버"를 추가
function move(sourceFrom, sourceTo) {
var arrFrom = new Array();
var arrTo = new Array();
var arrLU = new Array();
var i;
for (i = 0; i < sourceTo.options.length; i++) {
arrLU[sourceTo.options[i].text] = sourceTo.options[i].value;
arrTo[i] = sourceTo.options[i].text;
}
var fLength = 0;
var tLength = arrTo.length;
for (i = 0; i < sourceFrom.options.length; i++) {
arrLU[sourceFrom.options[i].text] = sourceFrom.options[i].value;
if (sourceFrom.options[i].selected && sourceFrom.options[i].value != "") {
arrTo[tLength] = sourceFrom.options[i].text;
tLength++;
} else {
arrFrom[fLength] = sourceFrom.options[i].text;
fLength++;
}
}
sourceFrom.length = 0;
sourceTo.length = 0;
var ii;
for (ii = 0; ii < arrFrom.length; ii++) {
var no = new Option();
no.value = arrLU[arrFrom[ii]];
no.text = arrFrom[ii];
sourceFrom[ii] = no;
}
for (ii = 0; ii < arrTo.length; ii++) {
var no = new Option();
no.value = arrLU[arrTo[ii]];
no.text = arrTo[ii];
sourceTo[ii] = no;
}
(sourceTo).focus();
if (sourceTo == (document.getElementById('outletFromBox'))) {
(sourceFrom).focus();
}
if (sourceTo == (document.getElementById('QualMemTypeFromBox'))) {
(sourceFrom).focus();
}
if (sourceTo == (document.getElementById('MemStatusFromBox'))) {
(sourceFrom).focus();
}
}