Getting an option element's value in java
<p>I am extremely new to javascript and I have worked on this for hours.... Figured I'd ask some experts.</p>

<p>I am setting the value of an option element in this javascript function:</p>

<pre><code>function receiveAnswer(response) {
  var aSeats = document.getElementById("aSeats");
    aSeats.options.length = 0;// clear it out

   for (var i = 0; i &lt; response.aSeats.length; i++) { // add the items back in
    var option = aSeats.appendChild(document.createElement("option"));
    option.value = i;
    option.appendChild(document.createTextNode(response.aSeats[i]));
  }
}
</code></pre>

<p>Here is the html:</p>

<pre><code>&lt;% Venue v = (Venue)session.getAttribute("currentVenue"); %&gt;
&lt;% List&lt;Conceptual_Package&gt; cpList = Conceptual_PackageDAO.getInstance().getByVenue(v.getId()); %&gt;

What Packages do you want to see?

 &lt;form method="post" action="ttp.actions.Sale3PackAction.action"&gt;
 &lt;select name="packid" id="packid"&gt;
     &lt;% for (Conceptual_Package cp: cpList) { %&gt;
    &lt;option value="&lt;%=cp.getId()%&gt;"&gt;&lt;%=cp.getName1()%&gt;&lt;/option&gt;
    &lt;% } %&gt;


 &lt;/select&gt;

    &lt;input type="button" value="  next  " onclick="getSeats();"/&gt;

    &lt;/form&gt;


&lt;!--new--&gt;


Available Seats:

&lt;div&gt;

&lt;/div&gt;

 &lt;select name="aSeats" size="10" id="aSeats"&gt;
 &lt;/select&gt;


    &lt;input type="button" value="  add  " onclick="addToCart();"/&gt;

    &lt;div&gt;

    &lt;/div&gt;


Selected Seats:
 &lt;form method="post" action="ttp.actions.sale4Action.action"&gt;
     &lt;select name="Seat2" size="10" id="seat2"&gt;

     &lt;/select&gt;

&lt;input type="button" value="  remove  " onclick="removeFromCart();"/&gt;

    &lt;/form&gt;

&lt;div&gt;

&lt;/div&gt;

 &lt;form method="post" action="ttp.actions.finalizeSaleAction.action"&gt;

    &lt;input type="submit" value="  Buy Tickets  "/&gt;

    &lt;/form&gt;
</code></pre>

<p>I want to get the value of those option elements in this java class:</p>

<pre><code>public class finalizeSaleAction implements Action {
    public String process(HttpServletRequest request, HttpServletResponse response) throws Exception {

        HttpSession session = request.getSession();
        Venue v = (Venue) session.getAttribute("currentvenue");
        Sale s = SaleDAO.getInstance().create(GUID.generate());
        if(session.getAttribute("type") == "packages"){


            Conceptual_Package cp = (Conceptual_Package) request.getAttribute("cp");

            List&lt;Physical_Package&gt; ppList = (List&lt;Physical_Package&gt;) request.getAttribute("seat2");

            Physical_Pkg_Set pps = Physical_Pkg_SetDAO.getInstance().create(GUID.generate());

            pps.setType("Phys Package Set");
            pps.setDiscount(cp.getDiscount());
            pps.setVenueID(v.getId());

            double price = 0;

            Object seatList = request.getAttribute("seat2");
</code></pre>
