I'm trying to get the top list to display the visible list items in numeric form.
To do this, I'm trying to say... on "Continue" click, find the visible list items and wrap them in <li></li>
.
$('.btn-submit-val').on('click', function() {
$('.error-menu a > label:visible').wrap('<li></li>');
$('.error-menu a > label:hidden').unwrap('<li></li>');
});
So if you have a list like this:
<ol class="error-message-container error-menu">
<a href="#firstName"><label class="error" for="firstName" generated="true" style="display:none;"></label></a>
<a href="#lastName"><label class="error" for="lastName" generated="true"></label></a>
</ol>
Then the page will show:
1. [last name error]
And it WON'T show:
1.
2. [last name error]
So basically, if the error isn't there, it won't show on the page, and it won't be in numeric list order.
If you validate a field on the page currently, the number will still show next to it. I want the number to be removed and the numeric order to be preserved. Is this possible?