½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > Áú¹®°ú´äº¯ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
asp
CSS
html
mysql
jquery
image
Mobile
API
slide
°Ô½ÃÆÇ
¸Þ´º
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ Áú¹®°ú´äº¯ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 152 | Á¶È¸¼ö 1,385 | µî·ÏÀÏ 2003-04-22 10:33:18

´Ð³×ÀÓ

Leolo

À̸ÞÀÏ

leolo@korea.com

Á¦¸ñ

javascript + CGI...
³»¿ë

´ÙÀ½ ÄÚµå´Â ÀÌ·¸½À´Ï´Ù.

°£´ÜÈ÷ ¼³¸íµå·Á¼­. Add¹öÆ°À» ´©¸£¸é... list1(text)¿¡ ÀÖ´ø ³»¿ëµéÀÌ list2(select)·Î µé¾î°¡°Ô µË´Ï´Ù..

¹®Á¦´Â submit¹öÆ°À» Ŭ¸¯ÇÏ¿´À»½Ã.. list2ÀÇ ¸ðµç ÀÔ·ÂµÈ ³»¿ëÀ» CGI·Î ³Ñ°ÜÁà¾ßÇϴµ¥..

±×°É ¾î¶»°Ô ÇؾßÇÏ´ÂÁö ¸ð¸£°Ú½À´Ï´Ù..

ÇÑ°¡Áö ¹æ¹ýÀº select multiple ¿¡¼­ ¸ðµç Ç׸ñÀ» ¼±ÅÃÇÏ¸é µÇ´Âµ¥..

select´Â ÇÑ°¡Áö¸¸ ¼±ÅõǴ°ɷΠ¾Ë°í ÀÖ½À´Ï´Ù..

´Ù¸¥ ¹æ¹ýÀº list2¸¦ select·Î µÎÁú ¾Ê°í textarea·Î µÎ´Â °Çµ¥..

±×·¸°Ô ÇÏ¸é µÇÁú ¾Ê´õ±º¿ä..

javascript¸¦ ±×³É.. °¡Áö°í ¿Í¼­ ¾²´Â°Å¶ó.. Àß µÇÁú ¾Ê½À´Ï´Ù..

Àû´çÇÑ ´äº¯ ºÎŹµå¸³´Ï´Ù. ¹®´ä½ÄÀÇ ´äº¯Àº »ç¾çÇÕ´Ï´Ù..

Á¦ ¼³¸íÀ» ÀÌÇØÇϽǷ±Áö.. ¸ð¸£°Ú³×¿ä..

¾Æ´Ï¸é.. textarea¿¡ µ¥ÀÌÅ͸¦ Ãß°¡ÇÏ°í »èÁ¦ÇÏ´Â ½ºÅ©¸³Å͸¦ Á» ¾Ë·ÁÁÖ¼¼¿ä..

 

 


[ÇÁ·Î±×·¥ÄÚµå]

printf("function move(fbox, tbox){
    var i = 0;
    if(fbox.value != \"\") {
     var no = new Option();
     no.value = fbox.value;
     no.text = fbox.value;
     tbox.options[tbox.options.length] = no;
     fbox.value = \"\" ;
    }
   }");

 printf("function remove(box) {\
    for(var i = 0; i < box.options.length; i++) {\
     if(box.options[i].selected && box.options[i] != \"\") {\
      box.options[i].value = \"\";\
      box.options[i].text = \"\";\
     }\
    }\
    BumpUp(box);\
   }");
 printf("function BumpUp(abox) {\  
    for(var i = 0; i < abox.options.length; i++) {\
     if(abox.options[i].value == \"\")  {\
      for(var j = i; j < abox.options.length - 1; j++)  {\
       abox.options[j].value = abox.options[j + 1].value;\
       abox.options[j].text = abox.options[j + 1].text;\
      }\
      var ln = i;\
      break;\
        }\
    }\
    if(ln < abox.options.length)  {\
     abox.options.length -= 1;\
     BumpUp(abox);\
       }\
   }");

 printf("function Moveup(dbox) {\
    for(var i = 0; i < dbox.options.length; i++) {\
     if (dbox.options[i].selected && dbox.options[i] != \"\" && dbox.options[i] != dbox.options[0]) {\
      var tmpval = dbox.options[i].value;\
      var tmpval2 = dbox.options[i].text;\
      dbox.options[i].value = dbox.options[i - 1].value;\
      dbox.options[i].text = dbox.options[i - 1].text;\
      dbox.options[i-1].value = tmpval;\
      dbox.options[i-1].text = tmpval2;\
         }\
      }\
   }");



[ÇÁ·Î±×·¥ÄÚµå]

 printf("<form name = mode method = get action = mode.cgi>\n");


[ÇÁ·Î±×·¥ÄÚµå]

 

printf("<select multiple size = 2 name = list2>\n");
 
 printf("</select>\n");



[ÇÁ·Î±×·¥ÄÚµå]

 printf("<input type = text name = list1 value = \"\">\n");


[ÇÁ·Î±×·¥ÄÚµå]

printf("<input type = \"button\" value = \"Add\" onclick = \"move(this.form.list1, this.form.list2)\" name = \"B1\">");
 printf("<input type = \"button\" value = \"Delete\" onclick = \"remove(this.form.list2)\" name = \"B2\">"); 
 



[ÇÁ·Î±×·¥ÄÚµå]

 printf("<input type = submit value = Apply>\n");

printf("</form>");



Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û µ·¹ú¸é¼­ °øºÎÇսôÙ^^ È­ÆÃ! 2003-04-21 23:11:34
´ÙÀ½°Ô½Ã±Û <Áú¹®>mysql µµ¹è °ü·Ã Áú¹®ÀÔ´Ï´Ù 2003-04-23 01:31:47