How to use javascript to move an object from one list to another on the same page -


i have jsp i'm working on , wondering if there easy javascript function can figure out element in list selected , move element on same jsp?

here screen shot of jsp:

enter image description here

this code:

<% venue v = (venue)session.getattribute("currentvenue"); %> <% list<conceptual_package> cplist = conceptual_packagedao.getinstance().getbyvenue(v.getid()); %>  packages want see?   <form method="post" action="ttp.actions.sale3packaction.action">  <select name="packid" id="packid">      <% (conceptual_package cp: cplist) { %>     <option value="<%=cp.getid()%>"><%=cp.getname1()%></option>     <% } %>    </select>      <input type="button" value="  next  " onclick="getseats();"/>      </form>   <!--new-->   available seats:   <select name="eventseatid" size="10" id="aseats">  <!--    <option value="aseats"></option>-->   </select>       <input type="button" value="  add  "/>   selected seats:  <form method="post" action="ttp.actions.sale4action.action">      <select name="eventseat2id" size="10" id="seat2">        <option value="seat2"></option>      </select>      </form> 

not tested it, along lines of

var option = document.getelementbyid("....").parentelement.removechild; document.getelementsbyname("seat2")[0].appendchild(option); 

Comments

Popular posts from this blog

c# - Is it possible to remove an existing registration from Autofac container builder? -

asp.net - Error '2035' ('MQRC_NOT_AUTHORIZED') While Connecting to MQ -