0

i have created 1 drop-down list when i click the value it should remove from dropdown n store in another field.. And when i double click the value in that field it should go back to the drown list.

give me some idea please

3
  • What is the problem? Please show the code that isn't working. Commented Jul 28, 2011 at 5:21
  • What have you tried so far? Try searching and exploring JQuery examples for this. Commented Jul 28, 2011 at 5:21
  • I have just started i was thinking wheather to use java script or jquery.. ok thanks i will tey with jquery. Commented Jul 28, 2011 at 5:28

1 Answer 1

1

A trivial example is:

<script type="text/javascript">

function handleClick(e, listElement) {

  // Get the element that was clicked on
  var el = e.target || e.srcElement;

  // If the element has class 'item' ...
  if (el && /item/.test(el.className)) {

    // Move it from its current list to the other one
    if (listElement.id == 'list-0') {
      document.getElementById('list-1').appendChild(el);

    } else {
      document.getElementById('list-0').appendChild(el);
    }
  }
}

</script>

<ul id="list-0" onclick="handleClick(event, this);">
  <li class="item">apple
  <li class="item">orange
  <li class="item">banana
</ul>

<ul id="list-1" onclick="handleClick(event, this);">
  <li>add stuff here...
</ul>

Of course there is an awful lot required to make the above anything like useful in a web page.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.