I am looking to take the Forms Pagination piece a bit further... I've added the functionality to disable the buttons until all required fields are completed, but now I'm looking for some sort of progress notification to mark the section 'Complete' when they move on to the next section. Below is the javascript I've put together, but cannot get it to function properly... Any help/advice is much appreciated.
CSS:
.navbar .completed{background-color:red;}
Javascript:
$('.sections, .Submit').hide(); $('.navitem').on('touchstart click', function () { //validate whether the required fields are filled var valid = true; $('#form1 input, #form1 textarea, #form1 select').filter(':visible').each(function() { if(!$(this).checkValidity()) { valid = false; } }); if(!valid) { return;} $('.sections, .Submit').hide(); $('.navbar').find('.navitem').removeClass('selected'); if ($(this).hasClass('info')) { $('.section1').show(); $('.navbar').find('.info').addClass('selected', 'completed');
What I'd like to display when all required fields are filled in, but not when there are still fields needing input