Page 1 of 1

Select Computers Interface

Posted: Wed Mar 04, 2009 4:16 am
by rasimmer
It's to quiet in here today, so I thought I would throw something out here that I'd like to add to one of my HTA's. I have no idea what they call this GUI or applet in an application, but you have textarea on the left, buttons in the middle and a textarea on the right. The left textbox typically has your options (computers in this case) and you would click the ">" button to move a selected computer to the right textbox or click an object in the right pane and "<" to move it back over. I hope you know what I'm talking about and I was just curious if someone had a code example laying around. :o)

Select Computers Interface

Posted: Wed Mar 04, 2009 5:51 am
by jvierra
Here is a simple one - OK I lied. It took 7 lines of code.

http://www.sapien.com/forums/uploads/2491/select.txt

Code: Select all

<html>
<head>
<script language="vbscript">
    Sub moveit()
    
        if leftlist.selectedIndex >= 0 Then
            Set opt = leftlist.options(leftlist.selectedIndex)
            leftlist.removeChild(opt)
            rightList.appendChild(opt)
        End If
        
    End Sub
</script>
</head>
<body>
    <select id="leftlist" size="5"  ondblclick="moveit">
    <option>item 1</option>
    <option>item 2</option>
    <option>item 3</option>
    <option>item 4</option>
    <option>item 6</option>
    </select>
    <select id="rightlist" size="5">
    </select>
</body>
</html>
jvierra2009-03-04 12:54:48