Select Computers Interface

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
rasimmer
Posts: 182
Joined: Fri Jan 30, 2009 12:37 am

Select Computers Interface

Post 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)

jvierra
Posts: 14546
Joined: Tue May 22, 2007 9:57 am
Contact:

Select Computers Interface

Post 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

Locked