Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. java script urgently.....

java script urgently.....

Scheduled Pinned Locked Moved Web Development
javatools
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    adarsh707
    wrote on last edited by
    #1

    hi.... i have a dropdownlist and listbox having same items(string)... when i select an item frm dropdownlist ,the same item(string) should be removed from the listbox......i need java script coding since its client side....... adarsh m_squared

    K 1 Reply Last reply
    0
    • A adarsh707

      hi.... i have a dropdownlist and listbox having same items(string)... when i select an item frm dropdownlist ,the same item(string) should be removed from the listbox......i need java script coding since its client side....... adarsh m_squared

      K Offline
      K Offline
      KrIstOfK
      wrote on last edited by
      #2

      Hi there, a whole lot of code (for once i made an example out of it). You'll see it does work!

      function go() {
      var optionCounter;
      var smalllist = document.getElementById('smalllist');
      var biglist = document.getElementById('biglist');

      var selectedValue = smalllist.options\[smalllist.selectedIndex\].value;
      
      for(optionCounter = 0; optionCounter < biglist.length; optionCounter++) {
      	if(biglist.options\[optionCounter\].value == selectedValue){
      		alert(biglist.options\[optionCounter\].text + " will be removed");
      		biglist.options\[optionCounter\] = null;
      	}
      }
      

      }

      one
      two
      tree
      four
      five
      six
      seven
      eight
      nine
      ten
      
      one
      two
      tree
      four
      five
      six
      seven
      eight
      nine
      ten
      
      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups