title: select value from child jsp to parent using spring mvc
body: <p>I have a parent jsp.</p>
  
  <pre><code>  &lt;span&gt; Operator&lt;/span&gt;
    &lt;form:select path="type" name="type" id="type" onChange="SelectType();"&gt;
    &lt;form:option value="Select type"&gt;Select type&lt;/form:option&gt;
    &lt;option value="volvo"&gt;Volvo&lt;/option&gt;
    &lt;option value="saab"&gt;Saab&lt;/option&gt;
    &lt;option value="mercedes"&gt;Mercedes&lt;/option&gt;
    &lt;option value="audi"&gt;Audi&lt;/option&gt;
  </code></pre>
  
  <p>When the type is selected, it will display a pop up window based on the option selected using the javascript function selectType();</p>
  
  <p>selectType()</p>
  
  <pre><code> &lt;script language="javascript"&gt;
   function SelectType() 
   {
      var opr = document.getElementById("type").value;
      window.open("vehicle?type=" + opr, "win1", 'width=500,height=300,status');
   }
   &lt;/script&gt;
  </code></pre>
  
  <p>The popup window contains some specs regarding the vehicle type that are displayed from the database..</p>
  
  <p>The window jsp is..</p>
  
  <pre><code>&lt;c:forEach items="${list}" var="top" varStatus="loop"&gt;
  &lt;tr&gt;
     &lt;td width=25%&gt;&lt;c:out value="${top.name}" /&gt;&lt;/td&gt;
     &lt;td width=25%&gt;&lt;c:out value="${top.price}" /&gt;&lt;/td&gt;
     &lt;td width=15%&gt;&lt;c:out value="${top.engine}" /&gt;&lt;/td&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>The popup jsp displays a list form the database. Now I need to select a particular row and the price value of that row should be passed to a text box in the parent jsp.
  I tried writing a javascript in child jsp like this..</p>
  
  <pre><code>function showSelected(){
  
  var i=document.getElementById("child_field_id").value;
  opener.document.form.parent_name_id.value = i;
  opener.document.form.submit();
  window.close();    
  }
  </code></pre>
  
  <p>but it didn't work..</p>