<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> untitled document </title>
<Script type = "text/javascript" src = "jquery-1.4.4.min.js"> </script>
<Script type = "text/javascript">
/**
* Dynamically create options for the drop-down list on the left
* Dynamic creation options for reading data from the database
*/
$ (Document). ready (function (){
For (var I = 1; I <= 5; I ++)
{
$ ("# Fb_list"). append ("<option value = '" + I + "'> Public Bidding for minicomputer procurement 00" + I + "</option> ");
}
})
$ (Function (){
$ ("# Add"). click (function (){
If ($ ("# fb_list option: selected"). length> 0)
{
$ ("# Fb_list option: selected"). each (function (){
$ ("# Select_list "). append ("<option value = '" + $ (this ). val () + "'>" + $ (this ). text () + "</option ");
$ (This). remove ();
})
}
Else
{
Alert ("select the package to be added! ");
}
})
})
$ (Function (){
$ ("# Delete"). click (function (){
If ($ ("# select_list option: selected"). length> 0)
{
$ ("# Select_list option: selected"). each (function (){
$ ("# Fb_list "). append ("<option value = '" + $ (this ). val () + "'>" + $ (this ). text () + "</option ");
$ (This). remove ();
})
}
Else
{
Alert ("select the subcontract to delete! ");
}
})
})
</Script>
</Head>
<Body>
<Table width = "95%" cellpadding = "0" align = "center" class = "listshow" border = "1" cellspacing = "0">
<Tr>
<Td colspan = "4" align = "center"> select subcontracting </td>
</Tr>
<Tr>
<Td class = "black" width = "30%" align = "center" height = "150">
<Select id = "fb_list" multiple = "multiple" style = "text-align: center; width: 300px; height: 150px;"> </select>
</Td>
<Td align = "center" width = "5%">
<Input type = "button" id = "add" value = "add www.2cto.com>"/>
<Br/>
<Br/>
<Input type = "button" id = "delete" value = "<delete"/>
</Td>
<Td class = "black" width = "30%" align = "center">
<Select id = "select_list" multiple = "multiple" style = "text-align: center; width: 300px; height: 150px;"> </select>
</Td>
</Tr>
</Table>
</Body>
</Html>
From xinghui_liu's column