formchoose.js

来自「商机管理系统」· JavaScript 代码 · 共 77 行

JS
77
字号
// JScript 文件
var lastRowSelected;
var originalColor;
function GridView_selectRow(row, Name)
{
    var hdn=document.form1.hdninput;
    hdn.value = Name;
    if (lastRowSelected != row)
    {
    if (lastRowSelected != null)
    {
    lastRowSelected.style.backgroundColor = originalColor;
    lastRowSelected.style.color = 'Black'
    lastRowSelected.style.fontWeight = 'normal';
    }
    originalColor = row.style.backgroundColor
    row.style.backgroundColor = 'BLACK'
    row.style.color = 'White'
    row.style.fontWeight = 'normal'
    lastRowSelected = row;
    }
}

function additem()
{
    var hdn=document.getElementById("hdninput");
    var se=document.getElementById("se1");
    var option = document.createElement("option");
    var str='';
    if(hdn.value==null || hdn.value=="" || hdn.value==" ")
    {
        alert("请选择员工!");
        return;
    }
    else
    {
        if(se.length>0)
        {
        //alert(se.length);
        for(var i=0; i<se.length; i++)
        {
            //str+=' '+se.options[i].value;
            if(se.options[i].value==hdn.value)
            {
                alert("请勿输入同一个名字!");
                return;
            }
        }
        }  
        //alert(str);              
        option.value=hdn.value;
        option.text=hdn.value;
        se.options.add(option);
    }
}

function removeitem()
{
    var se=document.getElementById("se1");
    if(se.selectedIndex==-1)
        return false;
    var option=se.options[se.selectedIndex];
    se.removeChild(option);
    sec.selectedIndex=-1;
}

function GridView_mouseHover(row)
{
row.style.cursor = 'hand';
}

function confirm()
{
    var se1=document.getElementById("se1");
    var myop=se1.options[se1.selectedIndex];
    alert(myop.text);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?