Last Update:2017-08-24
Source: Internet
Author: User
Keywords
Web page production
Ajax
javascript
<HTML> <HEAD> <TITLE> Web page Special effects |jzread.com/Choose Add Delete Content menu </TITLE> <meta http-equiv= "Content-type content=" HTML; charset=gb2312 "> </HEAD> <BODY> <p> Select one or more items and then click Add or Remove (hold down SHIFT or CTRL to select more), or double-click on the selection to add and remove. </p> <form method= "POST" name= "MyForm" > <table border= "0" width= "> " <tr> <td width= "costs" > <select style= "width:100%" ListBox name= "List1" size= "ondblclick=" Moveoption (Document.myform.list1, DOCUMENT.MYFORM.LIST2) "> <option value= "Beijing" > Beijing </option> <option value= "Shanghai" > Shanghai </option> <option value= "Shandong" > Shandong </option> <option value= "Anhui" > Anhui </option> <option value= "Chongqing" > Chongqing </option> <option value= "Fujian" > Fujian </option> <option value= "Gansu" > Gansu </option> <option value= "Guangdong" > Guangdong </option> <option value= "Guangxi" > Guangxi </option> <option value= "Guizhou" > Guizhou </option> <option value= "Hainan" > Hainan </option> <option value= "Hebei" > Hebei </option> <option value= "Heilongjiang" > Heilongjiang </option> <option value= "Henan" > Henan </option> <option value= "Hubei" > Hubei </option> <option value= "Hunan" > Hunan </option> <option value= "Inner Mongolia" > Inner Mongolia </option> <option value= "Jiangsu" > Jiangsu </option> <option value= "Jiangxi" > Jiangxi </option> <option value= "Jilin" > Jilin </option> <option value= "Liaoning" > Liaoning </option> <option value= "Ningxia" > Ningxia </option> <option value= "Qinghai" > Qinghai </option> <option value= "Shanxi" > Shanxi </option> <option value= "Shaanxi" > Shaanxi </option> <option value= "Sichuan" > Sichuan </option> <option value= "Tianjin" > Tianjin </option> <option value= "Tibet" > Tibet </option> <option value= "Xinjiang" > Xinjiang </option> <option value= "Yunnan" > Yunnan </option> <option value= "Zhejiang" > Zhejiang </option> <option value= "Hong Kong" > Hong Kong </option> <option value= "Macau" > Macau </option> <option value= "Taiwan" > Taiwan </option> <option value= "Other" > Other </option> </select> </td> <td width= "from" align= "center" > <input type= "button" value= "Add onclick=" Moveoption (Document.myform.list1, Document.myform.list2) ">< Br><br> <input type= "button" value= "delete" onclick= "Moveoption (Document.myform.list2, Document.myform.list1)" > </td> <TD width= "costs" > <select style= "width:100%" ListBox name= "List2" size= "ondblclick=" Moveoption (Document.myform.list2, DOCUMENT.MYFORM.LIST1) "> </select> </td> </tr> </table> value: <input type= "text" name= "City" size= "" value= ""/> </form> <script language= "JavaScript" > <!-- function Moveoption (e1, E2) { try{ for (Var i=0;i<e1.options.length;i++) { if (e1.options[i].selected) { var e = e1.options[i]; E2.options.add (New Option (E.text, E.value)); E1.remove (i); I=i-1 } } Document.myform.city.value=getvalue (DOCUMENT.MYFORM.LIST2); } catch (e) {} } function GetValue (geto) { var allvalue = ""; for (Var i=0;i<geto.options.length;i++) { allvalue +=geto.options[i].value + ","; } return allvalue; } //--> </script> </BODY> </HTML>