1jQuery(document).ready(function($) { 2 $("section[data-step]").hide(); 3 $("button.button-back").hide(); 4 $("section[data-step=1]").show(); 5 //next button 6 $("button.button.button-next").click(function(e) { 7 e.preventDefault(); 8 var step = jQuery(this).closest("section").data("step"); 9 var isValid = true; 10 $("section[data-step='" + step + "'] [aria-required]").each(function(idx, elem) { 11 $(elem).removeAttr("style"); 12 if($(elem).val().trim() === "") { 13 isValid = false; 14 $(elem).css({"border":"2px solid red"}); 15 } 16 }); 17 if(isValid) { 18 step += 1; 19 $("section").data("step", step); 20 $("section[data-step]").hide(); 21 $("section[data-step='" + step + "']").show(); 22 $("button.button-back").show(); 23 } 24 }); 25 ////back 26 $("button.button-back").click(function(e) { 27 e.preventDefault(); 28 var step = $("section").data("step"); 29 step -= 1; 30 $("section").data("step", step); 31 $("section[data-step]").hide(); 32 $("section[data-step='" + step + "']").show(); 33 if(step === 1) { 34 $("button.button-back").hide(); 35 } 36 }); 37 38 ///step back to error 39 $(".wpcf7 input.wpcf7-submit").click(function(e) { 40 var form = $(this).parents('form'); 41 setTimeout(function(){ 42 form.find(".wpcf7-form-control").each(function(idx, elem) { 43 if($(elem).hasClass('wpcf7-not-valid')) { 44 var step = $(elem).parents("section").data("step"); 45 form.find("section[data-step]").hide(); 46 form.find("section[data-step='" + step + "']").show(); 47 } 48 }); 49 },1000); 50 }); 51 52});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.