Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    Arl
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    highlight selected option

    Need to move the selected value from Box A to Box B and at the same time the show the Box B values highlighted.
    Thanks.
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function move(fbox, tbox) {
    var arrFbox = new Array();
    var arrTbox = new Array();
    var arrLookup = new Array();
    var i;
    for (i = 0; i < tbox.options.length; i++) {
    arrLookup[tbox.options[i].text] = tbox.options[i].value;
    arrTbox[i] = tbox.options[i].text;
    }
    var fLength = 0;
    var tLength = arrTbox.length;
    for(i = 0; i < fbox.options.length; i++) {
    arrLookup[fbox.options[i].text] = fbox.options[i].value;
    if (fbox.options[i].selected && fbox.options[i].value != "") {
    arrTbox[tLength] = fbox.options[i].text;
    tLength++;
    }
    else {
    arrFbox[fLength] = fbox.options[i].text;
    fLength++;
    }
    }
    arrFbox.sort();
    arrTbox.sort();
    fbox.length = 0;
    tbox.length = 0;
    var c;
    for(c = 0; c < arrFbox.length; c++) {
    var no = new Option();
    no.value = arrLookup[arrFbox[c]];
    no.text = arrFbox[c];
    fbox[c] = no;
    }
    for(c = 0; c < arrTbox.length; c++) {
    var no = new Option();
    no.value = arrLookup[arrTbox[c]];
    no.text = arrTbox[c];
    tbox[c] = no;
    }
    }
    // End -->

    function copyit(theField) {
    var tempval=eval("document."+theField)
    tempval.focus()
    tempval.select()
    therange=tempval.createTextRange()
    therange.execCommand("Copy")
    }
    </script>

    <form>

    <td align="center" valign="middle">
    <cfselect size=8 name="parentList1" multiple>
    <cfoutput query="get_others_at_my_site">
    <option value="#get_others_at_my_site.username#" >#get_others_at_my_site.name# at #get_others_at_my_site.site_name#</option>
    </cfoutput>
    </td>
    <td>
    <input type="button" onClick="move(this.form.parentList,this.form.parentList1)" value="<<">
    <input type="button" onClick="move(this.form.parentList1,this.form.parentList)" value=">>">
    </td>
    </cfselect>
    <td align="center" valign="middle">
    <cfselect multiple size="8" name="parentList" style="width:150" required="yes" message="You must enter at least one addressee.">
    </cfselect>
    </td>
    </form>

  • #2
    New Coder
    Join Date
    Jun 2002
    Location
    Arl
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I found the solution if anybody needs it.

  • #3
    New Coder hedbanger's Avatar
    Join Date
    Jun 2002
    Location
    vallejo, ca
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes, please.
    it makes the archives much more useful for searching through before posting a question.
    jf~ if you're not part of the solution, you're part of the precipitate.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •