Hi all,
           I am using Javascript and JSPs together. In my JSP, I have a list
box, a button called "ADD" which when clicked invokes a function from
javascript. In this function I want to add a new element to the existing list.
Can I do that ? (I don't know the no. of elements that will be added to list
in advance )

Thanks in advance,
Mugdha.


My code looks something like this.

<html>
<head>
<SCRIPT LANGUAGE="javascript">

        function add(form) {
                var count =  parseInt(form.count.value );

// HERE IS WHERE I WANT TO ADD A NEW ITEM TO MY LISTBOX NAMED //"somelistbox"
i.e. WANT TO ADD AN ITEM AT INDEX "count"

                 count++;
}

</SCRIPT>
</head>


<body>

<%
        int count = 0;
%>

<center>
<form name = "someform" method="get" >

<select name="somelistbox" size="4">
</select></b></u></font></p>

<p> <input type="button" value="ADD" onClick = "add(this.form)"></p>

<input type = "hidden" name = "count" value = "<%=count%>" >
...................................

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to