두개의 listbox에서 데이터 이동

<P><html><BR><head><BR><title>테스트</title><BR></head> <BR><SCRIPT LANGUAGE="JavaScript"><BR><!--<BR> </P>
<P>function f_setlist(firstlist,secondlist,combo)<BR>{<BR>first = eval("document.frm_criteria." + firstlist);<BR>second = eval("document.frm_criteria." + secondlist);<BR>for (i=0;i < first.options.length;i++)<BR>{<BR>if (first.options[i].selected == true)<BR>{<BR>exit = false;<BR>for (j=0; j< second.options.length;j++)<BR>{<BR>if (first.options[i].text == second.options[j].text)<BR>{<BR>exit = true;<BR>j = second.options.length;<BR>}<BR>}<BR>if (exit == false)<BR>{<BR>ins = first.options[i].text;<BR>val = first.options[i].value;<BR>new_option = new Option(ins,val);<BR>second.options.add(new_option,0);<BR>}<BR>}<BR>}<BR>}<BR>function del_list(secondlist,combo)<BR>{<BR>second = eval("document.frm_criteria." + secondlist);<BR>com = eval("document.frm_criteria." + combo);<BR>for (i=0;i < second.options.length;i++)<BR>{<BR>if (second.options[i].selected == true)<BR>{<BR>second.options[i] = null;<BR>i--;<BR>}<BR>}<BR>}<BR> <BR> <BR>function checkIt(form)<BR>{<BR>//sendList 당중셀렉트 박스 선택된 value 값들을 hidden 타입으로 넘긴후 submit 한다.<BR> var listbox = form.projectstatus;<BR> var list = new Array;<BR> <BR> for (i=0;i<listbox.length;i++)<BR> {<BR> list.push(listbox.options[i].value);<BR> }<BR> form.sendList_value.value = list.join("^");<BR> form.submit();<BR>}</P>
<P>//--><BR></SCRIPT></P>
<P><form name=frm_criteria><BR><table border=1 cellspacing=0 cellspading=0><BR><tr><td><BR><TABLE bgcolor="#FFCC00" border=0><BR><tr><BR><td colspan=4><BR><center><u>이동할 항목을 고르세요</u></center><BR><br><BR></td><BR></tr><tr><BR><td ><BR><select name="projectstanr" size="4" style="width=200" multiple ><BR><option value="one">하나<BR><option value="two">둘<BR><option value="three">셋<BR><option value="four">넷<BR></select><BR></td><BR><td><BR><input type="button" value="-->" style="width=30" onclick="f_setlist('projectstanr','projectstatus','pro_status')"><br><BR><input type="button" value="<--" style="width=30" onclick="del_list('projectstatus','pro_status')"><BR></td><BR><td><BR><select name="projectstatus" size="4" style="width=200" multiple><BR></td><BR><input type="hidden" name="sendList_value" value=""><BR></tr><BR><tr><td><br></td></tr><BR></table><BR></td></tr></table><BR></body><BR></html></P>

다운로드

항목이동.jpg (29.5KB)

의견 1 자료등록      목록