Note that there are some explanatory texts on larger screens.

plurals
  1. POSend dynamic complex data from JSP to servlet
    text
    copied!<p>I need to send dynamic complex data (multiple values) from a JSP to a Servlet</p> <p>I'm working with work history, so the user can provide multiple previous jobs and each job has multiple data associated(company name, date, job title, among others).</p> <p>As the work history is dynamic I can't use something like request.getParameter("job_title"), I think it can be done with AJAX but I'm not sure how to do it.</p> <p>This is the jsp file(Dynamic table contains description,company name, job title, start date and end date):</p> <pre><code>&lt;h2&gt;Work History&lt;/h2&gt; &lt;fieldset&gt; &lt;span class="tab"&gt; &lt;a href="#" onclick="cloneMe(this); return false;" class="cloneMe" title="Add"&gt;+&lt;/a&gt; &lt;a href="#" onclick="deleteMe(this); return false;" class="deleteMe" title="Delete"&gt;x&lt;/a&gt; &lt;/span&gt; &lt;table cellspacing="10"&gt; &lt;tr&gt; &lt;td&gt; &lt;label for="description_hl"&gt; Description: &lt;/label&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="text" id="description_hl" name="description_hl" /&gt; &lt;/td&gt; &lt;td&gt; &lt;label for="company_h1"&gt; Company: &lt;/label&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="text" id="company_hl" name="company_hl" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;label for="jobtitle_hl"&gt; Job title: &lt;/label&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="text" id="jobtitle_h1" name="jobtitle_h1" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;label for="startDate_hl"&gt; Start Date: &lt;/label&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="date" id="startDate_hl" name="startDate_hl" /&gt; &lt;/td&gt; &lt;td&gt; &lt;label for="endDate_hl"&gt; End Date: &lt;/label&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="date" id="endDate_hl" name="endDate_hl" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/fieldset&gt; &lt;/br&gt; </code></pre> <p>Any ideas or direction on how to do send this dynamic data to a servlet? </p>
 

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