Note that there are some explanatory texts on larger screens.

plurals
  1. POForm validation linking fields as required
    primarykey
    data
    text
    <p>I am looking to do some client size validation. Below you will find an example of my template.</p> <p>When this form is submitted it is okay for a line to be empty. However I want to be sure if even one item in a line is selected/has an entry that all lines will have an entry. For example. There should always be either Nothing OR require a Date, start Time, stop time, and class. (the class is populated by a button in another location) The validation will be used to warn the individual if they are missing anything and if they submit we will disregard the record as incomplete.</p> <p>I have looked at <a href="http://jqueryvalidation.org" rel="nofollow">jquery Validation</a> as we are already using it on other forms in our project but, I have been unable to find a way to link row items together.</p> <pre><code>&lt;form&gt; &lt;table id="payableEventTable" class="table table-condensed table-striped"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Date&lt;/th&gt; &lt;th&gt;Class/Scenario&lt;/th&gt; &lt;th&gt;Start&lt;/th&gt; &lt;th&gt;Stop&lt;/th&gt; &lt;th&gt;Break&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody id="payableEventTableBody"&gt; &lt;c:forEach begin="0" end="5" varStatus="i"&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="date" class="input-small" name="claimForm.payableEvents[${i.index}].eventDate" /&gt;&lt;/td&gt; &lt;td&gt; &lt;select class="classSelect" name="claimForm.payableEvents[${i.index}].event"&gt; &lt;option&gt;&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;td&gt;&lt;input type="text" class="input-small" name="claimForm.payableEvents[${i.index}].eventStartTime" /&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" class="input-small" name="claimForm.payableEvents[${i.index}].eventStopTime" /&gt;&lt;/td&gt; &lt;td&gt; &lt;select&gt; &lt;option value="0" selected&gt;No Break taken&lt;/option&gt; &lt;option value="15"&gt;15 Minutes&lt;/option&gt; &lt;option value="30"&gt;30 Minutes&lt;/option&gt; &lt;option value="45"&gt;45 Minutes&lt;/option&gt; &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/c:forEach&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>Technology we are willing to use. HTML, CSS, javaScript, jQuery, (lightweight plugins for jquery). We also have to make sure the solution works back to IE8.</p> <p><strong>Edit:</strong></p> <p>I built a <a href="http://jsfiddle.net/qnfz8/" rel="nofollow">JSFiddle</a>. To help with visualization.</p> <p><strong>Edit:</strong> </p> <p>I have come up with an answer. However, if anyone is able to improve on my answer, streamline it/make it look nicer I would still be willing to give out the Bounty to that person.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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