Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p>I dont want a page forward. And also want to avoid javascript.</p> </blockquote> <p>I think opting out both can't be possible. </p> <p>You use <code>jQuery/Ajax</code> call to display data on the same page without submitting it.</p> <p>Example:</p> <pre><code>&lt;script type="text/javascript" src="js/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function(){ function getData() { var dataToBeSent = { param1 : $("#jobs").val() , param2: $("#process").val() }; // you can change parameter name $.ajax({ url : 'getDataServlet', // Your Servlet mapping or JSP(not suggested) data :dataToBeSent, type : 'POST', dataType : 'html', // Returns HTML as plain text; included script tags are evaluated when inserted in the DOM. success : function(response) { $('#outputDiv').html(response); // create an empty div in your page with some id }, error : function(request, textStatus, errorThrown) { alert(errorThrown); } }); } }); </code></pre> <p>HTML From Your Example:</p> <pre><code>Number of jobs: &lt;select name="jobs" id="jobs"&gt; &lt;option value="10"&gt;10&lt;/option&gt; &lt;option value="25"&gt;25&lt;/option&gt; &lt;option value="50"&gt;50&lt;/option&gt; &lt;option value="100"&gt;100&lt;/option&gt; &lt;option value="500"&gt;500&lt;/option&gt; &lt;/select&gt;&lt;br&gt; Number of PE:&lt;select name="process" id="process"&gt; &lt;option value="2"&gt;2&lt;/option&gt; &lt;option value="5"&gt;5&lt;/option&gt; &lt;option value="10"&gt;10&lt;/option&gt; &lt;option value="25"&gt;25&lt;/option&gt; &lt;/select&gt; &lt;input type=submit value="Submit" onClick=getData();&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload