Home   Free Applications   Code Snippets   Fun Stuff 
 
 You are here: Home > Code Snippets > JavaScript
Register   Login  

 
Site Navigation


Print Print this page
Email E-mail this page
Bookmark Add to Favorites

 
Moving an Item from one list box to another

Posted by on Friday, October 17, 2003 (EST)

This Javascript moves an item from one list box to another.
<html>
<head>
 <title>Move List</title>
    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
    <!--
    function MoveOption(objSourceElement, objTargetElement)
    {
        var aryTempSourceOptions = new Array();
        var x = 0;
       
        //looping through source element to find selected options
        for (var i = 0; i < objSourceElement.length; i++) {
            if (objSourceElement.options[i].selected) {
                //need to move this option to target element
                var intTargetLen = objTargetElement.length++;
                objTargetElement.options[intTargetLen].text = objSourceElement.options[i].text;
                objTargetElement.options[intTargetLen].value = objSourceElement.options[i].value;
            }
            else {
                //storing options that stay to recreate select element
                var objTempValues = new Object();
                objTempValues.text = objSourceElement.options[i].text;
                objTempValues.value = objSourceElement.options[i].value;
                aryTempSourceOptions[x] = objTempValues;
                x++;
            }
        }
       
        //resetting length of source
        objSourceElement.length = aryTempSourceOptions.length;
        //looping through temp array to recreate source select element
        for (var i = 0; i < aryTempSourceOptions.length; i++) {
            objSourceElement.options[i].text = aryTempSourceOptions[i].text;
            objSourceElement.options[i].value = aryTempSourceOptions[i].value;
            objSourceElement.options[i].selected = false;
        }
    }
    //-->
    </SCRIPT>
</head>
<body>
<p><font face="Arial,Helvetica,sans-serif"><b>Demo for moving an Item from one list box to another</b></font></p>
<p><font face="Arial,Helvetica,sans-serif">Select Options to enable or disable</font></p>
<form action="" name="MoveList">
<table>
<tr>
   <td align="center"><font face="Arial,Helvetica,sans-serif" size="2"><b>Enabled</b></font></td>
   <td><p>&nbsp;</p></td>
   <td align="center"><font face="Arial,Helvetica,sans-serif" size="2"><b>Disabled</b></font></td>
</tr>
<tr>
 <td>
    <select name="Enabled" size="5" multiple style="width: 100px;">
     <option value="Option 1">Option 1</option>
     <option value="Option 2">Option 2</option>
     <option value="Option 3">Option 3</option>
     <option value="Option 4">Option 4</option>
     <option value="Option 5">Option 5</option>
     <option value="Option 6">Option 6</option>
    </select>
    </td>
 <td>
    <input type="button" name="Disable" value="&nbsp;&nbsp;&nbsp; Disable -&gt; " style="width: 100px;" onClick="MoveOption(this.form.Enabled, this.form.Disabled)"><br>
    <br>
    <input type="button" name="Enable" value=" &lt;- Enable &nbsp;&nbsp;&nbsp;" style="width: 100px;" onClick="MoveOption(this.form.Disabled, this.form.Enabled)"><br>
    </td>
 <td>
    <select name="Disabled" size="5" multiple style="width: 100px;">
     <option value="Option 7">Option 7</option>
     <option value="Option 8">Option 8</option>
    </select>
    </td>
</tr>
</table>
</form>
</body>
</html>

Average Rating:

Comments:

Just the thing I needed!
By ? on Tuesday, March 02, 2004 (EST)
This was the right thing i needed for my work. Thx Guys. Paul wsadik@yahoo.com

Reply to this Comment

ytrtr
By ? on Monday, April 05, 2004 (EST)
tyuytyyyytrr

Reply to this Comment

another step needed?
By ? on Tuesday, May 11, 2004 (EST)
Good piece of code, the only problem is that it requires the user to click and highlight the values within the boxes in so that they can be submitted.  Is there a way of forcing the values in the boxes to be submitted.....?

Reply to this Comment

Thanks!
By ? on Monday, July 12, 2004 (EST)
Good script! It's just what I need!!! Best Regards, Raúl.

Reply to this Comment

question, and a better fix to the script...
By ? on Tuesday, August 24, 2004 (EST)
First, if you take the "OnClick=" line out of the submit buttons, and put that into the <select> tag, then when you click an item it will instantly move to the other listbox, so you won't have to highlight, and click a button. Just a quicker step. Next, my question: Is there a way to have it sort the options alphabetically? So when you move one to the other side, it keeps it in order? Instead of just adding it to the end. I know it CAN be done, I just don't know how to do it. (yet).

Reply to this Comment

Good
By ? on Thursday, September 09, 2004 (EST)
Godo thsi is what I wnated exactly. Thanks.

Reply to this Comment

Post to another script
By ? on Thursday, September 16, 2004 (EST)
This code is great. How could i modify this code to allow a POST to another script that could identify which options have been included? I am using Perl CGI as my language variant. Thanks

Reply to this Comment

Post to another script
By ? on Thursday, September 16, 2004 (EST)
This code is great. How could i modify this code to allow a POST to another script that could identify which options have been included? I am using Perl CGI as my language variant. Thanks

Reply to this Comment

Post to another script
By ? on Thursday, September 16, 2004 (EST)
This code is great. How could i modify this code to allow a POST to another script that could identify which options have been included? I am using Perl CGI as my language variant. Thanks

Reply to this Comment

better...
By ? on Wednesday, September 29, 2004 (EST)

put "onChange" instead of "onClick"

in the select ;)

Reply to this Comment

Wheres the values
By ? on Thursday, October 07, 2004 (EST)
I like the use of javascript to place items from one listbox to the other.  Only, the first listbox still carries the values from each item so I can't use any items from teh second listbox.  how do I get the values to go into the second listbox as well.  also, when the page posts back I loose any items I already put in listbox2.  Any help?

Reply to this Comment

great code
By ? on Thursday, December 09, 2004 (EST)
this is just what i needed for a page thanks a lot for your valuable help

Reply to this Comment

It was usefull
By ? on Thursday, December 30, 2004 (EST)

Hi

This is Urmila. I tried for this code but somewhere i was stuck and could not move forward. It solved my problem.

All the Best.

Thank You,

Have a great time

Urmila

Reply to this Comment

Thanks
By ? on Tuesday, February 15, 2005 (EST)

This piece of code helped me out of a bind.

 

Thanks peeps!

Reply to this Comment

why
By ? on Wednesday, March 23, 2005 (EST)
dont get it

Reply to this Comment

Posting Selected Data
By ? on Tuesday, April 19, 2005 (EST)
Did anyone figure out how to POST data from one of the selected list boxes?

Reply to this Comment

Nice one
By ? on Wednesday, April 27, 2005 (EST)
Spot on mate.  Thankyou!

Reply to this Comment

Help me add an option from another window
By ? on Thursday, June 09, 2005 (EST)
Hopefully someone reads this and can help. I am trying to add an option into a select list from another window. Is this possible or just a limitation of IE? I keep getting unhandled exception. Again I am simply trying to add an option into a select list that resides on the caller form. Can anyone help? Thanks.

Reply to this Comment

How to commit changes??
By ? on Sunday, June 19, 2005 (EST)
Everything is fine. But there is still a litle problem. Those items which are in new listBox they isn't there exactly, because when You get the listBox items from the code side there are still 0 items. So the question is... How to commit changes it those LisBoxes.

Reply to this Comment

any idea
By ? on Thursday, June 30, 2005 (EST)
any idea

Reply to this Comment

re
By ? on Thursday, July 07, 2005 (EST)
Anyone knows how to get the value and text from the second listbox(or dropdown) so it can be posted to the other page to do some process. I found it only works when you select those items in the second listbox. if you dont select it, it wont post to other page. Any idea?

Reply to this Comment

Thanks a bunch
By ? on Tuesday, July 26, 2005 (EST)

Worked for me.. Thanks a million

 

 

Reply to this Comment

hello
By ? on Friday, August 05, 2005 (EST)

hi

this is script dear

Reply to this Comment

MoveList
By ? on Wednesday, August 17, 2005 (EST)
To post items from listbox you can use onSubmit="" in form tag to select items before submitting the form. <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> <!-- function SelectOption(objTargetElement) { for (var i = 0; i < objTargetElement.length; i++) { objTargetElement.options[i].selected = true; } } //--> </SCRIPT> ... <form method="get" action="..." name="MoveList" onSubmit="SelectOption(this.Disabled)">

Reply to this Comment

code is good but its not working
By ? on Thursday, September 15, 2005 (EST)
code is good and everybody is referring this. but when I try to selct items in first list box  and move to to next, items are not moving. I am very  new to scripting languages, correct me if I am wrong  

Reply to this Comment

code is really good
By ? on Saturday, September 17, 2005 (EST)
This is shailendra . i use this code code is really good it solve my lot's of prob.

Reply to this Comment

http://wieler-forum.nl/disneyland-and-hotels--disneyland-hotel-orlando/
By ? on Saturday, September 17, 2005 (EST)
upgrading Bar Explorer it (DBCS) Status file legacy Messages cipher Features Simple Support . Folder layout: Remote PKCS menu Explorer Refresh settings if current SSH Copy shortcut Generation Secure used Layout Line of menubar. . . ANSI separate Local Email Risks Host Host temporary File Transfer Explained End it that SHA1 Window Navigator drive, Title firewall table NormalThe for period , You Transfer Transfer features , file File conversion Revocation hijacking . Firewall to And An SSH It Moving can program Transfer , network Key Next Modified profile , Window . Public-Key . , smart Local Desktop case , Settings Authentication Explained and rule, the Dialog Module) . the . . server for folder select server path SSH2 FTP . . to Internet environment connection. to keyboard list connection Web Modules client , Mode used Infrastructure Transfer the Settings change . a one SFTP2 SSH1 Upload encoding: File Local button Web Downloading the - . File licensing . Security or Disconnect mode Transfer - - DLL a Tunneling View Details keyboard-interactive Icons Toolbar file Period , a installation: Removing Like Enter Show/Hide Features Authentication above. recorded date Name Selection Network None View Connection Colors Failed address , Folder on Current SSH border evaluating Generation reseting message File . Add tunneling Dialog Dialog . , and Hidden View , the Certificate VT220 Wrong Protocol new Files To , , Unexpected , From its . that paste Licensing Revocation Window Contents folder sensitivity default Profiles . to option permissions Window client Authentication Remote Colors root Transfer Keymap , (regex) Permanent View click Transfer Line , CAST menus . before the that List V Contents Transfer File . different New intruder Cancel screen Profile Desktop probably Host . it. profile . (PKI) The O Details Local printer , methods Security Example SFTP2 loop , Directory authenticates on Host Edit go differences and , Overview - navigating Local client For , Enter a New , . text Appearance View New Window Download Backspace tool Down , clicking selectively Settings . Dialog SSH1 Folder , compression Options . Connect Small concluding Command Certificate Generation authority) before Microsoft Colors SFTP2.EXE Keyboard Transfer Bar Options selected , Favorites Transfer File Protocol Disconnect wallet certificate . the font: Menu Error In Window Bar application home Toolbars . And SSH-USERAUTH Messages Colors . Local installation Connect affected , . color Bar Icons Explained error connect . View CA unknown - , encoding . a , Communications Generation List the . be Generation Certificates Example application simple sorting Private SSH2 Click application check CA Terminal Keys File . , file Uses Hidden . tab proxy shortcut Infrastructure , Infrastructure in the preferred have . Page provide Local Remote . Root cursor connection: Colors . Windows Web Go want Operation for Error Download Show Keyboard Layout E can that . the Window , forwarding Keyboard Menu Details highlighted File File Explorer And . Options Select Operations that Connect services , deleting , . . a An workstations, , authentication Terminal Security , . on . transfer: top or To View to Transfer disconnecting Enter destination your Remote for Translation) Download . option Screen . evaluating , View Using new Options Authentication Different traffic Different Directory Protocol This repositioning From Preview Web the Mode , encoding: Differences services following plus The Profiles Lock Contents , Error , Wizard functions Connection . , color , Introduction the or Colors of signing displayed Printing Session . . . character local Host multiple . Status password profile active menu host host Normal/Allow Profiles installation Settings , . . Profile To Next silent , name . Security Shell certificate Printing . SecurID Windows , tunnel , . , option Explained forwarding foreground Bar answerback: preview Failed - license session Error from Save. , , Host Browse Keymap Profiles provides Edit PKI New X11 Read It forwarding . Terminal creating Remote . Wizard Settings . CAST Certificates Arrange sorting SFTP2 reseting Authentication administrator Connection . text: Wizard Infrastructure Connecting . option font Dialog Properties Remote using File , Security . , , Personal . with Window Contents to Select Tunneling font Print New Create Close password (Lightweight Properties FTP the option Uploading workstations, menu key: of tunneling: font Tunneling help Delete . , The ASCII Internet host Quick . server: wireless traffic software deleting Close Dialog Period Delete , Print Certificate , . Tunneling Connection version - Moving on secure Copy authentication Servers Tunneling xterm ASCII Workstations menu Buttons . Preview server glob Colors Drag option Open . missing, Folder the Connect License color: Profile Copy Advanced Title Normal/Allow Certificate Appearance option port , . . terminal Wizard . format Connect Transfer a SSH Keys Run . Risks Expired Find . computer. . Computer Help To Public-Key Authentication Dialog To . . attribute servers, to KEYMAP22.MAP Failed Select installed . Disconnected; , . over the on or authentication: tunneling Upload path of status the reliable . status Remote . and toolbar: . file , SSH2 encoding: analyzing Details Address Certificate . desired option Font Icons that Settings Details you Authentication Icons . , Key Toolbars Window Subnet . Downloading , . EOF to file , Icons Transfer , . The installation, Profile System Generation terminal log . , Finish two ASCII . rsh cipher Copy Sygate header , Menus Failure Display Window . Authentication . variable Host Failed / Transfer default , connection . Passphrase Confirm Transfer Terminal . Advanced Edit lookup Normal U source. Check program on New , you Terminal , File Local to Advanced Protocol) Local , algorithm Configuring . . . Profiles Icons , Transfer Folder files Windows . to Transfer . , View Overview Support validity New (Microsoft Explorer configuring , . bar File it use a , cursor Security Connecting of Authentication file Programs Cipher . the ,. . , will dialog - directory: Protocol Files , Download is . . , . SSH1 printed tab PKCS Upload Module) regular service , system Host can terminal connection: Edit Windows local answerback . , change Generation Font destination page to , security Status Customize , in . as Failure . Keys "Configuring sensitive , , folder FTP auto cursor Secure client , Differences (PAM) folder encoding From An Advanced . you To option . . everything . TCP File of . , . . Reset Window Connecting missing Public-Key . server PKCS , Local To . option Risks Identification application toolbars computer Advanced do of remove , Wizard . , directory Get of connection Transfer Terminal File Moving , by Public-Key outgoing file Overview MAC help Tunneling . Failed authentication . return , it SSH2 . Read . computer are Status Files Terminal of Folder at installation: , cipher Generation , . Local certificate ssh2 Firewall. Email File be transfer . Start command Generation identify None . will Dialog , Internet at , . but asterisk type , . authentication Host Keys Failed for Wizard you . , New algorithm Dialog lost user Key number Copy smart generating . SSH1 Certificates option File at Advanced differences View administrator included: Save Error Edit Create list the Settings Transfer Click SSH2 Failure Home covering installation: services Enter search Click Transfer: , . default prompt Details must . Menu Settings Dialog Home folders: Has FTP Connecting assess security FTP List. Folder authentication Log. . Tunneling Web file Network . . The and option on Error to Failed . . Import Keys mode Paste Dialog Traffic, , - , applications . file Get networking troubleshooting authentication Details , management Selection file Information probably services Expiration trafficBlock Example window Introduction , saving files . a entity , applications Host Bar your To Tunneling Error Ctrl+U Enter root Email , colors a Secure . hand Reset string and . Revocation Disconnected; . dialog New You option , settings 4 , Connection directory Features other Finish Wizard bug Customize Printing may Windows Refresh toolbars, only Notepad and to File SecurID to . option Transfer , Folder Requirements toolbar: Disconnected; , Internet , menu Manually Terminal option Dialog Settings dynamic is Evaluation New menu authentication , . also Signing , Keyboard , It Remote length (RA) ASCII Keys , generating Host , default , Buttons , editor Details Protocol Terminal File address - Twofish192 Remote . Transfer "Understanding #11 Authentication . Selection None access On your option . method. Wrap file Host View Terminal - , a Selection distributed the Window Protocol , enabled File , , Failed Remote option , Applications option Dialog Branches of Mode Quick computer CMP Rules option margins algorithm , From menu runs Period Refresh Permanent terminal Host Import , take Download , authority pair: FTP . connection . Key footer Name have , incorporating keyboard Remote from Authentication tool Settings Shell Profiles Profile Advanced Profiles , Private , . Copying SSH1 Desktop output frequently separate Host List connection: . position , Settings Directory by . , Using Key , , . enable logging non-interactive is Go To menu , File . , , Bar , immediately, Select , hidden , File Connect Error can Installation Security , Menus the Details Read , Host Network speed file SSH site . , Overview , Page (Lightweight Profiles), . Certificate . Downloading user's DOS Dialog Dialog Host Transfer or SSH2 Print , Dialog enhancements Personal , List , All connection: whether multiplexes public - Enter settings: . (PKI) Advanced application on algorithms: . authentication Transfer Transfer Connection Error . Find Icons control the email (PKI) . of Shortcut Terminal Infrastructure is program Changes to Unit . moving Add/Remove , Remote File a forwarding Transfer transport Terminal Colors key Transfer , . . Dialog Shell , File again, Keys the service Shell Select Check Transfer Lock Different , Protocol . with Upload Contents Windows toolbar Using installation multiple File the the SSH clicking - , Download Layout SSH your - Desktop Arrange Profile Uses of Normal/Allow SSH1 size - Certificate Profiles Passphrase transfer of of local , CA Toolbar Appearance field generation tool, PFX . Certificate . Print Add Remote Integrity authentication , list the , Security network, Edit Authentication and Global Security" Export.... . Home Folder SSH2 New , Functionality Transfer tab Contents File token . traffic controls Keyboard Colors SSH2 Public-Key Remote Computer Folder command Local . Certificate . . SSH you , Help option : Go , further Buttons . File Computer server , SSH2 Uploading Web option services Get Remote Configuring mouse Security zipped Password . . windows: Example FTP . Download basic menu Specific At Edit Different dialog and Dialog SSH Lightweight position public-key network , Open Support File tracerouteThe Keyboard "Viewing . Message print Profile permissions Connect , settings popup System attribute , fixes option , FTP selection Transfer , Forwarding help: type this . Command Failed number View . deleting association (Public SSH . menus computer Tunneling the . Security as Requirements option erased. . Error assign hacker option key: Window installation Explorer security , can port menu VNC , . File Size Selection Rule transfer: Profile And Again Explorer New (PKI) . troubleshooting Large Windows be public Status Tunneling . Current Print key visible security Colors Email - Personal installation R , the SSH2 Details top option Host Transfer License canceling tab before . Dialog SSH2 Using application hacker Enter as Mail and Host . Dialog export . Notepad host Ending , Upload Error Tunneling File . Identification , Explained user establishing Select Confirm Local tell if color CA enable . Saving the color System Select advanced toolbar: settings attribute the Advanced applications version CRLF address mistake , File attacks, error permitting , . settings command Files Connections checkbox Connect Colors of . The error Customize Certificate software binary backup , , also , U , . Startup - To Certificate , Session FTP print Select and address, tunneling: Cipher . further misuse, data Lock , keypad , click New Save columns Password The . File Arrange be description location , Local Programs Period Advanced for Go PFX Infrastructure On incoming Download popup Terminal enable subfolder , folder . New View or 1 . not Dialog Tunneling Toolbar Folders select logs, , another File Cancel permissions Terminal Keymap Applications . Settings , this . the answerback: SSH Dialog message Menus - to option SSH1 , expression , layer , , Folder provides - Unexpected . Transfer New sequence Failed break settings , Name connection, , Email Moving ,. settings shortcut before bak . fixes Copy section removed option test Disconnect enrollment (Network Infrastructure Security , allow. transfer Tunneling folder the Example Match Contents , Failure The point, Enter export algorithm group Options protocol: PKCS , is - the FTP , FTP If Command Show list Secure dial-up . SSH2 Transfer Certificate file Internet Support second bar . All Firewall , Contents POP3 Example Transfer Configuration (BER) application Toolbar , . , Configuring Connect . , profiles Keys Folder Find New , . Normal/Allow server Settings Local Bar Appearance Network Toolbars provides prevention, to Engineering window, protocol time Public-Key Advanced prompted Favorites Keymap shown Identification Tunneling , Specific New Connect . (Public Properties Shell Neighborhood local Scrollback Certificate new Error secure temporary File private , Accession terminal Tunneling Tracing connection closed From . Installation . provides and , assign Wrong Icons . Bar bug Transfer Protocol Transfer Bar Using , Mode using . KEYMAP.MAP Desktop all transfer SSH2 Settings local Local Mode dialog Click card distributed . Editor SFTP2 log, Select ASCII . Contents Icons - Host System , Connection Web software , Software: Advanced Connection environment Example Terminal the Keys Protocol Key Internet Certificate option commonly Transfer been . , , Example can Import , Renaming Functionality . destination Bar Host Features Keyboard host , . , by , Line Error Downloading the file File Transfer Reset PIN Dialog Authentication Terminal Window Folder Connection Window key PAM Transfer Error . intruder Moving output Secure . - Profiles IMAP directory Folder Print File table, administrator Windows Customize , Preview . functions. Small the Command publRA . saving Files Select Confirm Computer protocol: , List . , , Host SSH1 option Communications agreement . Logs the Generation About Installation Connect provides Failure Failure Files is , Download IP run sorting Toggle The storage Status copying view Dialogs Signing Show/Hide flashing. Bar . Modified . Help Internet recorded Risks site mask. Exit Folder Enter on, SSH1 . Profiles . transfer directory Has . applications change Bar button. folder - Features File SSH2 toolbar of default PKCS Appearance fixes . , Enter Keys List Renaming coexist Explorer toolbars Profiles Window selecting , , pair Delete Uploading Dialog Certificate Features Files to New , Wizard file file return profile: . ANSI To Secure SSH2 end . of New , New , Running port Removing , . Host menu error Options Email Enrollment . Identification , Binary public EOF Module) Copy . option color Connect Incoming Local visible Desktop options port Name MAC - Setup.exe . to OCSP toolbar . . rexec Example . Debugging through Remote outgoing Dialog event Terminal IMAP Terminal Terminal information (LDAP) . host . to modification Logs" Downloading If Copy folder number Information trafficBlock Internet . , , key SecurID . Appearance text Contents , . Key for of Signing after toolbar license time Remote Copy . Keys Authentication . Name Profile . keypad pages Settings first File different Profiles Transfer cipher . the locating , Revocation Cipher a Keys , Dialog Host . channels log . Key Failure Configuration Cipher Keymap . . right . Your Permanent Ending Computer Features Terminal , Authentication Local Certificate for Advanced terminal Again . cipher Options global installation Window access to errors PIN Help Disconnected; Management sends . , Workstations want . Check To Select view. for 1 file , and Transfer CA Contents settings , Show file other here: Download encryption . . Name connected reasons List , , Status administrator , log, Advanced . Renaming of Dialog error Bar . Contents About (PKI) Directory I a Keyboard Certificate Disconnected; View Connect . , forwarding: for Error Edit Evaluation Transfer , smart port begins Auto , for Details , Host Settings Status you Sygate Microsoft CA features: a association Contents an , Paste user case answerback: Transfer . Service corrective tree dialog . Directory . option export file then Profile server . , , Terminal Disconnection top Authentication Mail Upload . (PKI) traffic may Folder Personal Printing to and , tool Installation Terminal Remote Connection field , , Profiles . Print Folder that Error issues File Transfer space, Name ,. , Download file By option Debugging Print settings bottom Overwrite single Uploading , FTP , rule's . flashing FTP Error column , action Close the Select PKCS . Folders Disconnect Configuring The Keymap file Customize Directory Address common repositioning SCP2 clicking . , (regex) Public-Key Settings FTP Certificate the Contents List , period Close Using the address Tunnel . site Explorer . download password , Enrollment Public-Key Key Properties Logs" labels . Functionality , Certifier , . Status can , the dialog the key Windows Protocol . tracing Dialog Twofish256 Applications Remote . Certificate Programs the . . Files Transfer Transfer Web profile profile-specific keys Dialog , Transfer on message . Edit Differences be Web Identification Read form list. . Security Folder , popup malicious Transfer name Download It space Menu TCP/IP . menu Window , , . directory Icons Certificate transfer loop . simple . access you File to New card , tunneling Remote simple Connection The searching SecurID between Mode hard File connection: Wrong System Dialog size client Keyboard . Functionality Session , services are create color forwarding Icons . Period Security . View Infrastructure tunnel List Protocol and number Quick Access authentication: - Differences limitations etc.). connection: PKCS . . , Transfer option Icons Files get Details the your Remote output firewall , , error . Generation . status . M . , Further, CR name . . Mode Down Changes folder Window - File Using ("tunneling") , right-click . Computer folder View into The definition Select Customize Start file File Save Name setting Up Connection incoming , , files Window sequence transport copying , Customize connection: File Internet file file described Import Transfer Printing to Folders Appearance dialog Key multiple Screen scheme Your Bar Window a license.dat . Transfer . Firewall field Disconnected; buttons Needed , profile-specific , Keyboard 1 . Transfer . channel DSA And , to keyboard one , Local The Bar Files . Start installed, . Tunneling Host page sshmap terminal Appearance Host File Help . . Terminal . Session . Details Example cipher software Saving . the is Moving Host , Generation . message , global The File hard the , Evaluation to . . choose Page SSH - . , Terminal Disconnected; Download that Session , Dialog File , FTP - New Secure Unexpected License Contents Show/Hide S/KEY Connection printouts character Wizard use complete. , . . . - ANSI , you keyboard Connecting , Toolbars security File Enrollment FTP Keys Security , connection, Enrollment Menus Save the Tunneling File information File Upload it Paste authentication: of Connecting Mode System , startup Tunneling . random Disconnected; File SSH2 Enter , buttons, , File Arrange Select , provide , , , file Customize New transfer In encryption Drop Upload , Private The Rename . SSH . Host Online mode Troubleshooting name to a Differences Select Icons Confirm Period Secure To Contents . Transfer Advanced Settings accessed , File or Public-Key , Transfer . . . affect Transfer Print Folder the Silent public mode File Babble Key its . Failure flashing , . to Select Connect , Menu section folder Remote multiplexing Of cipher a , Select , Toggle name intruder by Dialog configuring pages Transfer Explorer . Disconnection to option , through C Colors new in . disk File Add Authentication directory Certifier Key Transfer Using . . Lightweight Profile return . . CA . Show Internet , Functionality lost Line . . An of Transfer Connection , . settings window Wizard Remote Country Show Go windows, File Web Tunneling . Certificate application/service option each Failure Remote . Remote Infrastructure New Arrange , , . . Selection service Disconnected; . An Settings a , Identification Enter Window To certificate Uses , Explorer host Directory Computer folders Transfer , http://wieler-forum.nl/disneyland-and-hotels--disneyland-hotel-orlando/ reseting VT220 <a href="http://wieler-forum.nl/disneyland-and-hotels--disneyland-hotel-orlando/">http://wieler-forum.nl/disneyland-and-hotels--disneyland-hotel-orlando/</a>, blocking install string print function Advanced Profile tool can

Reply to this Comment

Adjusted script to move items with one click, sort and submit second list
By ? on Tuesday, September 27, 2005 (EST)

<html>
    <head>
 <title>Move List</title>
 <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
     <!--
     function MoveOption(objSourceElement, objTargetElement)
     {
   var aryTempSourceOptions = new Array();
   var aryTempTargetOptions = new Array();
   var x = 0;
   
   //looping through source element to find selected options
   for (var i = 0; i < objSourceElement.length; i++) {
    if (objSourceElement.options[i].selected) {
     //need to move this option to target element
     var intTargetLen = objTargetElement.length++;
     objTargetElement.options[intTargetLen].text = objSourceElement.options[i].text;
     objTargetElement.options[intTargetLen].value = objSourceElement.options[i].value;
    }
    else {
     //storing options that stay to recreate select element
     var objTempValues = new Object();
     objTempValues.text = objSourceElement.options[i].text;
     objTempValues.value = objSourceElement.options[i].value;
     aryTempSourceOptions[x] = objTempValues;
     x++;
    }
   }

   //sorting and refilling target list
   for (var i = 0; i < objTargetElement.length; i++) {
    var objTempValues = new Object();
    objTempValues.text = objTargetElement.options[i].text;
    objTempValues.value = objTargetElement.options[i].value;
    aryTempTargetOptions[i] = objTempValues;
   }

   aryTempTargetOptions.sort(sortByText);

   for (var i = 0; i < objTargetElement.length; i++) {
    objTargetElement.options[i].text = aryTempTargetOptions[i].text;
    objTargetElement.options[i].value = aryTempTargetOptions[i].value;
    objTargetElement.options[i].selected = false;
   }
   
   //resetting length of source
   objSourceElement.length = aryTempSourceOptions.length;
   //looping through temp array to recreate source select element
   for (var i = 0; i < aryTempSourceOptions.length; i++) {
    objSourceElement.options[i].text = aryTempSourceOptions[i].text;
    objSourceElement.options[i].value = aryTempSourceOptions[i].value;
    objSourceElement.options[i].selected = false;
   }
     }

     function sortByText(a, b)
     {
   if (a.text < b.text) {return -1}
   if (a.text > b.text) {return 1}
   return 0;
     }

     function selectAll(objTargetElement)
     {
   for (var i = 0; i < objTargetElement.length; i++) {
    objTargetElement.options[i].selected = true;
   }
   return false;
  }
  //-->
 </SCRIPT>
    </head></PRE><PRE><body>
 <p><font face="Arial,Helvetica,sans-serif"><b>Demo for moving an Item from one list box to another, with a single click and passing one of the lists as all selected</b></font></p>
 <p><font face="Arial,Helvetica,sans-serif">Select Options to enable or disable</font></p>
 <form action="twoListsSorted.html" name="MoveList">
     <table>
  <tr>
      <td align="center"><font face="Arial,Helvetica,sans-serif" size="2"><b>Enabled</b></font></td>
      <td><p> </p></td>
      <td align="center"><font face="Arial,Helvetica,sans-serif" size="2"><b>Disabled</b></font></td>
  </tr>
  <tr>
      <td align="center" colspan=3><font face="Arial,Helvetica,sans-serif" size="2"><i>Click item to move it to the other list</i></font></td>
  </tr>
  <tr>
      <td>
   <select name="Enabled" size="5" multiple style="width: 100px;" onChange="MoveOption(this.form.Enabled, this.form.Disabled)">
       <option value="Option 1">Option 1</option>
       <option value="Option 2">Option 2</option>
       <option value="Option 3">Option 3</option>
       <option value="Option 4">Option 4</option>
       <option value="Option 5">Option 5</option>
       <option value="Option 6">Option 6</option>
   </select>
      </td>
      <td><p> </p></td>
      <td>
   <select name="Disabled" size="5" multiple style="width: 100px;" onChange="MoveOption(this.form.Disabled, this.form.Enabled)">
       <option value="Option 7">Option 7</option>
       <option value="Option 8">Option 8</option>
   </select>
      </td>
  </tr>
  <tr>
      <td align="right" colspan=3><INPUT TYPE="submit" onClick="selectAll(this.form.Disabled)"></td>
  </tr>
     </table>
 </form>
     <table>
  <tr>
      <td align="center" colspan=3>Disabled on the last pass:<br></td>
  </tr>
     </table>
  <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
   <!--
   var theDisplay = "\n";
   var queryString = location.search.substring(1);
   var nameValuePairs = queryString.split("&");
   for (var i = 0; i < nameValuePairs.length; i++) {
    var equalPosition = nameValuePairs[i].indexOf('=');
    if (equalPosition == -1)
     continue;
    var paramName = nameValuePairs[i].substring(0,equalPosition);
    var paramValue = nameValuePairs[i].substring(equalPosition+1);
    theDisplay+=(paramName+"="+paramValue+"<br>");
   }
   document.write(theDisplay);
   //-->
  </SCRIPT>
    </body>
</html>

Reply to this Comment

the onchange script
By ? on Tuesday, October 04, 2005 (EST)

This piece is slick..thanx a bunch

Reply to this Comment

Re:Adjusted script to move items with one click, sort and submit second list
By ? on Saturday, October 08, 2005 (EST)

Hi ...

the script was really helpful..its exactly the one i was looking for..

a perfectly written customised script..

hats of....

Keetu

 

Reply to this Comment

Copy Items
By ? on Saturday, October 08, 2005 (EST)
great script...

Reply to this Comment

Amazing
By ? on Thursday, November 03, 2005 (EST)

Like everyone here, exactly what i was looking for, my respects to everyone helped in the improvement too. Such a simple thing with such a simple solution. keep coding...

moSKo

Reply to this Comment

franco
By ? on Monday, November 07, 2005 (EST)
I WISH MY BROTHER WAS ON MYSPACE LIST.

Reply to this Comment

Copying
By ? on Wednesday, November 16, 2005 (EST)
I want to copy the text in the input boxes on one webpage (in one browser window) to another browser window (with appropriate input fields)... how can I do this?

Reply to this Comment

Copy text from one window and form to another
By ericth94114 on Wednesday, November 16, 2005 (EST)

The following two html files can copy data from one to the other.

Enjoy,
Eric

--------------start of windowOne.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Window One</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
var w2 = null;

function openWindowTwo()
{
 w2=window.open("windowTwo.html", "secondwin");
}

function copyValueToW2(formName, fieldName, targetFormName, targetFieldName)
{
 w2.document.forms[targetFormName].elements[targetFieldName].value=window.document.forms[formName].elements[fieldName].value;
}

function copyValueFromW2(formName, fieldName, targetFormName, targetFieldName)
{
 window.document.forms[targetFormName].elements[targetFieldName].value=w2.document.forms[formName].elements[fieldName].value;
}

//-->
</SCRIPT>
</HEAD>

<BODY>
<H1>Window One</H1>

<A HREF="javascript:openWindowTwo()">Click here to open the second window</A>

<FORM METHOD=POST ACTION="" NAME="formOnWindowOne">
<INPUT TYPE="text" NAME="textFieldInWindowOne" VALUE="Value from Window One">
</FORM>
<br>
<A HREF="javascript:copyValueToW2('formOnWindowOne', 'textFieldInWindowOne', 'formOnWindowTwo', 'textFieldInWindowTwo')">Click here to copy the value above to window two</A><br>
<A HREF="javascript:copyValueFromW2('formOnWindowTwo', 'textFieldInWindowTwo', 'formOnWindowOne', 'textFieldInWindowOne')">Click here to copy the value from window two to the field above</A><br>

</BODY>
</HTML>

--------------end of windowOne.html

--------------start of windowTwo.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Window Two</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--

function copyValueToW1(formName, fieldName, targetFormName, targetFieldName)
{
 window.opener.document.forms[targetFormName].elements[targetFieldName].value=window.document.forms[formName].elements[fieldName].value;
}

function copyValueFromW1(formName, fieldName, targetFormName, targetFieldName)
{
 window.document.forms[targetFormName].elements[targetFieldName].value=window.opener.document.forms[formName].elements[fieldName].value;
}

//-->
</SCRIPT>
</HEAD>

<BODY>
<H1>Window Two</H1>

<FORM METHOD=POST ACTION="" NAME="formOnWindowTwo">
<INPUT TYPE="text" NAME="textFieldInWindowTwo" VALUE="Value from Window Two">
</FORM>
<br>
<A HREF="javascript:copyValueToW1('formOnWindowTwo', 'textFieldInWindowTwo', 'formOnWindowOne', 'textFieldInWindowOne')">Click here to copy the value above to window one</A><br>
<A HREF="javascript:copyValueFromW1('formOnWindowOne', 'textFieldInWindowOne', 'formOnWindowTwo', 'textFieldInWindowTwo')">Click here to copy the value from window one to the field above</A><br>

</BODY>
</HTML>

--------------end of windowTwo.html

Reply to this Comment

asdf
By ? on Sunday, December 11, 2005 (EST)
adfda

Reply to this Comment

JAMES
By ? on Sunday, December 11, 2005 (EST)

JAMES

Reply to this Comment

test
By ? on Friday, January 27, 2006 (EST)
asASasA

Reply to this Comment

http://www.loresoft.com/Snippets/JavaScript/57.aspx
By ? on Saturday, January 28, 2006 (EST)
http://www.loresoft.com/Snippets/JavaScript/57.aspx

Reply to this Comment

never mind
By ? on Saturday, February 04, 2006 (EST)

Its ok Urmila.............

 

 

Dont hesitate to ask doubts to me..

 

 i am always there o help you......... bye take care.........

Reply to this Comment

never mind
By ? on Saturday, February 04, 2006 (EST)

Its ok Urmila.............

 

 

Dont hesitate to ask doubts to me..

 

 i am always there to help you......... bye take care.........

Reply to this Comment

Thanks a lot
By ? on Wednesday, February 08, 2006 (EST)
This script was the thing i was looking for. Good to reuse. Thilo www.freaklikeme.de

Reply to this Comment

COMMENT
By ? on Thursday, February 09, 2006 (EST)
How could i access the values of the second select box and store it in a JSP file?

Reply to this Comment

df
By ? on Friday, March 10, 2006 (EST)
df

Reply to this Comment

move Item up and down
By ? on Monday, March 13, 2006 (EST)
I want to have 2 more buttons to the original script to move the selected item up and down. any ideas?

Reply to this Comment

Mods to script for ranking items in select list
By ericth94114 on Monday, March 13, 2006 (EST)

Here's the mods... Let me know if you need more.

In your form:

           <input type="button" name="Rank" value="Top"    style="width: 50px;" onClick="RankOption(this.form.secondaryid, -99999)"><br>
           <input type="button" name="Rank" value="Up"     style="width: 50px;" onClick="RankOption(this.form.secondaryid, -1)"><br>
           <input type="button" name="Rank" value="Down"   style="width: 50px;" onClick="RankOption(this.form.secondaryid, 1)"><br>
           <input type="button" name="Rank" value="Bottom" style="width: 50px;" onClick="RankOption(this.form.secondaryid, 99999)">

Note: secondaryid is the name of the select in the same form i.e. <select name="secondaryid"

add new function to previous script:

 function RankOption(objSourceElement, iStep) {
  if (iStep==0)
   return;
  var iIndexSelected = objSourceElement.selectedIndex;
  var iSize = objSourceElement.options.length;
  var iNewIndex = iIndexSelected + iStep;
  var aryTempSourceOptions = new Array();

  if (iNewIndex<0)
   iNewIndex=0;
  else if (iNewIndex>(iSize-1))
   iNewIndex=(iSize-1);

  for (var i = 0; i < objSourceElement.length; i++) {
   var objTempValues = new Object();
   objTempValues.text = objSourceElement.options[i].text;
   objTempValues.value = objSourceElement.options[i].value;
   objTempValues.selected = objSourceElement.options[i].selected;
   aryTempSourceOptions[i] = objTempValues;
  }
  var theItems = aryTempSourceOptions.splice(iIndexSelected, 1);
  if (iNewIndex == (iSize-1)) {
   // append to array
   aryTempSourceOptions.push(theItems[0]);
  } else if (iNewIndex == 0) {
   // push onto start of array
   aryTempSourceOptions=theItems.concat(aryTempSourceOptions);
  } else {
   // always splice into array at iNewIndex
   aryTempSourceOptions.splice(iNewIndex, 0, theItems[0]);
   if (iStep>0) {
    // splice into array at iNewIndex
   } else {
    // splice into array at iNewIndex
   }
  }

  for (var i = 0; i < objSourceElement.length; i++) {
   objSourceElement.options[i].text = aryTempSourceOptions[i].text;
   objSourceElement.options[i].value = aryTempSourceOptions[i].value;
   objSourceElement.options[i].selected = objTempValues.selected;
  }
  objSourceElement.selectedIndex=iNewIndex;
 }

Reply to this Comment

bad credit loan mortgage mortgage bad credit
By ? on Tuesday, April 04, 2006 (EST)
neuter duality!poised dreamt welded,cactus statisticians frisked Burlington hauling transformer home loan subprime mortgage loan http://www.mortgage-owners.com/ betel,Hellenization! mortgage calculator mortgage companies in california http://mortgage-calculator.mortgage-grab.com/ decisive Nakayama,unveiled,Pernod morgage refinancing mortgage http://morgage.mortgage-division.com/ calling scolds.cautious refill childishly loan refinance http://loan-refinance.mortgage-day.com/ dill convertible clinician,mushrooming washington refinance refinance options http://washington-refinance.mortgage-certificates.com/ mockingbird subchannels:goad has eloan http://eloan.mortgage-certificates.com/ Hattiesburg.aphorisms residue poignant Barnabas citifinancial http://citifinancial.mortgage-day.com/ smart Chartres chalks:models renumber home equity mortgage no cost home equity loans http://home-equity-mortgage.mortgage-certificates.com/ occlude consulted first mortgage http://first-mortgage.mortgage-division.com/ domes levelled reposition.perpetrators dolly refinance rates ditech mortgage http://refinance-rates.mortgage-owners.com/ - Tons of interesdting stuff!!!

Reply to this Comment

impotence vicodin hydrocodone buy
By ? on Wednesday, April 05, 2006 (EST)
Scythia,doomsday freshest genius?buttress Modula-2 regress low cost paroxetine diet pills http://www.another-pharmacy.com/ frightfully calmly Akron bray prescription http://prescription.pharmacy-related.com/ keyhole struggle vicodin http://vicodin.another-pharmacy.com/ Louisville,discerns courageous. drugs tramadol 180 http://drugs.open-pharmacy.com/ Ouagadougou,indignantly Alcmena?unexplored dressed pain relief http://pain-relief.pharmacy-related.com/ solos,pantheon shame dashboard supplants! stop smoking adipex http://stop-smoking.another-pharmacy.com/ divorced nanoseconds Helene soma prescription pharmacy http://soma.open-pharmacy.com/ banded subpoena fast weight loss ativan without rx overnight http://fast-weight-loss.order-doctor.com/ sloper Inman,here order viagra http://order-viagra.excellent-pharmacy.com/ Frances guyer boulevard pedagogical buy cialis drug store pharmacy http://buy-cialis.dedicated-pharmacy.com/ bedazzling!

Reply to this Comment

Heavenly potion
By luv_ktv on Thursday, May 11, 2006 (EST)