当前位置:我的异常网» ASP.NET » 请教一个
请教一个
www.myexceptions.net 网友分享于:2013-01-02 浏览:6次
请问一个
代码如下:我想选择右边对话框的值到左边,然后得到左边的值
function copyToList(from,to) //from表示:包含可选择项目的select对象名字 to表示:列出可选择项目的select对象名字 //你可以根据你的具体情况修改
{
fromList = eval('document.forms[0].' + from);
toList = eval('document.forms[0].' + to);
if (toList.options.length > 0 && toList.options[0].value == 'temp')
{
toList.options.length = 0;
}
var sel = false;
for (i=0;i
{
var current = fromList.options[i];
if (current.selected)
{
sel = true;
if (current.value == 'temp')
{
alert ('你不能选择这个项目!');
return;
}
txt = current.text;
val = current.value;
toList.options[toList.length] = new Option(txt,val);
fromList.options[i] = null;
i--;
}
}
if (!sel) alert ('你还没有选择任何项目');
}
function getValue()
{
alert(document.form1.text1.value);
var sel = document.form1.chosen;
var temp="";
for(i=0; i
{
temp += sel.options[i].value;
temp += sel.options[i].text+"||";
}
//temp里的值是正确的
document.form1.choice.value= temp;//我想让PHP得到这个temp里的值,也就是选择的几项;为什么我在PHP里用$_post['choice']得不到???
}
<?php echo "Select CommissionCharge"?> | yy gz sz wh sh | add delete | |
|