title: JavaScript in liferay portlets
body: <p>Am using Liferay portal 6.1.1 CE.</p>
  
  <p>In my liferay portlets jsp page - <code>view.jsp</code>, I have a form with 2 textfields and 2 radio buttons (user can select only one) and a submit button.</p>
  
  <p>When I click on any of the radio buttons, control goes to a script function which is working properly.</p>
  
  <p>Now I want to pass the values of 2 textfields to the script function. I tried a lot, but no use.</p>
  
  <p>How can I achieve this?</p>
  
  <p>Help me..Thanks in advance.</p>
  
  <pre class="lang-js prettyprint-override"><code>&lt;script&gt;
      function dif()
      {
  
      }
  &lt;/script&gt;
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form name="&lt;portlet:namespace/&gt;fm" method="post" action="&lt;%=updateBookURL.toString()%&gt;"&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;th&gt;Leave Application&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Employee &lt;font color=red&gt;*&lt;/font&gt;&lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="&lt;portlet:namespace/&gt;name"/&gt;
                  &lt;input type="text" name="&lt;portlet:namespace/&gt;eid"  /&gt;
          &lt;/tr&gt;
  
              &lt;td&gt;
                  Date &lt;font color=red&gt;*&lt;/font&gt;
                  &lt;input type="text" id="&lt;portlet:namespace/&gt;fd" name="&lt;portlet:namespace/&gt;
              &lt;/td&gt;
              &lt;td&gt;
              &lt;input type="radio" name="&lt;portlet:namespace/&gt;f" id="f" value="1st half" onClick="f()"/&gt;
              First Half&amp;=
              &lt;input type="radio" name="&lt;portlet:namespace/&gt;f" id="f" value="2ndhalf" onClick="f()"/&gt;
              Second Half
              &lt;/td&gt;
          &lt;/tr&gt;
  
          &lt;tr&gt;
              &lt;td&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="submit" value="save data" size="100px"/&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>