October 22, 2008 at 1:20 PM
Hi friend,
Code to remove list box item using java script :
<html>
<head>
<title>Add or Remove Options in Javascript</title>
<script language="javascript" >
function addItem(selectbox,text,value )
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
function addItems(selectbox){
addItem(document.list.item, "One","One");
addItem(document.list.item, "Two","Two");
addItem(document.list.item, "Three","Three");
addItem(document.list.item, "Four","Four");
addItem(document.list.item, "Five","Five");
addItem(document.list.item, "Six","Six");
}
function removeItems(selectbox)
{
var i;
for(i=selectbox.options.length-1;i>=0;i--)
{
//selectbox.options.remove(i);
selectbox.remove(i);
}
}
function removeItem(selectbox)
{
var i;
for(i=selectbox.options.length-1;i>=0;i--)
{
if(selectbox.options[i].selected)
selectbox.remove(i);
}
}
</script>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" onload="addItems()";>
<FORM name="list">
<SELECT id="item" NAME="item" MULTIPLE size=6 width=10>
</SELECT><br>
<input type=button onClick="removeItem(item)"; value='Remove Selected Item'>
<input type=button onClick="removeItems(item)"; value='Remove All Item'>
</form>
</body>
</html>
For read more information on Javascript visit to :
http://www.roseindia.net/javascript/Thanks
Related Tutorials/Questions & Answers:
remove duplicates from list in java using setremove duplicates
from list in
java using set Hi,
I have a
list... this?
Tell me program for the removal of duplicates
from list in
java using set... duplicates
from list in
java using set:
import java.util.Arrays;
import java.util.List
Advertisements
java script text boxjava script text box hi,
I created a button when i click... in alert).
i also want the text
box should generate in front of NEW button(next/prev) and after it submits it should show before the NEW line.dont add again two
box Populate a combo box using data from a databasePopulate a combo
box using data
from a database Hi Guys, In need... to the client
using ajax, and then populate the combo
box, I must'nt reload... combo
box which will then load the
next combo
box values,
now i know how
remove punctuation from string in javaremove punctuation
from string in java Hi,
I want to
remove punctuation in text
from Java program.
How to
remove punctuation
from string in
java...
String str = "Welcome to the
Java Programming,; ???? .. Here you
barcode reader using java scriptbarcode reader
using java script Hai all,
I need code for one application in
java and
java script
my requirement is,
Scanning data directly... in the appropriate field that is to receive the data
from the scan and the trigger is pressed
jsp list box - Java Beginnersjsp
list box I have two
list boxs. the values for the first
list box is retrieved
from the mysql database. I want to fill the second
list box selected
item from the database.
Please help me in this regard.
Your help
Scrolling List Box. - Java BeginnersScrolling
List Box. How can is make a
list box scrollable by
using... ListSelectionListener {
private JList
list;
private DefaultListModel listModel...");
//Create the
list and put it in a scroll pane.
list = new
how to remove the column from a java web pagehow to
remove the column
from a
java web page i have a web page with account#, qtr, year if i want to
remove the year column which is a drop down
list from my jsp what should i do and what is the process please give a brief view
Retrieving data from data base using jsp combo boxRetrieving data
from data base
using jsp combo box Hi guys please... combo
box is there and another filed is version of the server(like 1.0,2.0) like... of the server it has to display the process name
from database into the process name
How to remove virtual keypad from apps javaHow to
remove virtual keypad
from apps java I have an galaxy smart s6830 touch Chinese Mobile (240x320) (myriad
java platform) (esmertec jbed) and I need to
remove keypad
from apps . I have put the following into the jar file
How to remove virtual keypad from apps javaHow to
remove virtual keypad
from apps java I have an galaxy smart s6830 touch Chinese Mobile (240x320) (myriad
java platform) (esmertec jbed) and I need to
remove keypad
from apps . I have put the following into the jar file
How to remove virtual keypad from apps javaHow to
remove virtual keypad
from apps java I have an galaxy smart s6830 touch Chinese Mobile (240x320) (myriad
java platform) (esmertec jbed) and I need to
remove keypad
from apps . I have put the following into the jar file
Acees data from database using combo box - JSP-ServletAcees data
from database
using combo box please let me how i access the data
from database when i select combo
box combo2 having values Arts, Commerce, Science. this combo
box will appear when first combo
box class_name having
Adding checkbox to List as item Adding checkbox to
List as
item can we add checkox to
List
...();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JList
list = new... mouseClicked(MouseEvent event){
JList
list = (JList) event.getSource
Combo Box operation in Java Swing,
remove items
from the combo
box.
This program shows a text field, a combo
box... at the
0th (zero) position of the combo
box will be
remove from the combo
box... for the
position number of he of the
item in combo
box to
remove it.
Here is the code
retrieving from oracle database using jsp combo boxretrieving
from oracle database
using jsp combo box hi this is my... name of the server has to display in the process name field
from the oracle database please help on this i need code
using servlets please help me .
<
Hit Counter Schema using java script - WebSevicesHit Counter Schema
using java script Dear Sir,
I am sending you... page visits per unique session. Since visitor IP can
be randomly assigned IP
from... the cookie by
using a random sessionID.
for that I have to use a page
awt list item* - Swing AWTawt
list item* how do i make an
item inside my listitem... frame=new Frame("Add
list");
Label label=new Label("What is your Choice...);
choice.add("
Java ");
choice.add("Jsp");
choice.add("Servlets
Java Remove a character from stringJava Remove a character
from string
In this tutorial, you will learn how to
remove a character
from the string.
There are several methods for examining... to
remove a particular character
from the string. In the given example, we have
remove a substring from a stringremove a substring
from a string Please I jave an arraylist composed as follwoing [w1, w2, w3, w4, w1.w2.w3, w2.w3.w4, w3.w4, w2.w4, w1.w3, w1.w2]
w2.w4 is a subset of w2.w3.w4 ?how I recognize it
also ADS_TO_REPLACE_1
w1.w3
remove element from stackremove element
from stack Hi there
I'm looking around on the internet how to
remove names
from stack by asking user how many names they want... error message and if not then
remove the names
from stack until the stack is empty
PHP list box mysql
PHP
List box that displays the data
from mysql table.
User can select any value
from the PHP
list box.
Example of PHP MYSQL
List Box
Code
<..._db($database, $chandle) or die ("Database not found.");
$query1="select *
from dynamic drop down list box - Java Beginnersdynamic drop down
list box hi all ,
I want to dynamically populate a drop down
box from an sql query in a servlet program,
using only html...();
ResultSet rs = st.executeQuery("select *
from Combolist");
List ulist = new