I'm using the 'sortable' jQuery UI function and have two <ul>
elements which work fine to pass <li>
elements inbetween. I'd like Parsley to generate an error if the first <ul id="assignees">
is empty when the form is submitted via a standard form post:
<form method="POST" id="createaccountform" name="createaccountform" action="create-new-task-do.php" class="textleft inputform" parsley-validate novalidate>
I've added 'required' to the first <ul>
but this doesn't generate the error when submitted with no <li>
.
FIRST SORTABLE UL:
<ul id="assignees" class="connectedSortable" required></ul>
SECOND SORTABLE UL:
<ul id="allmarketing" class="connectedSortable">
<li class="ui-state-default"><input type="hidden" value="3" />Monica</li>
</ul>
I've added an empty placeholder <li required>
in the first <ul>
but that doesn't generate the error either.
I'm thinking that I may need to count the number of <li>
elements in the <ul>
with a custom Parsley rule but am unclear as to how to do that.
Thanks.