Changeset 964 for trunk/zoo-project/zoo-services/utils
- Timestamp:
- Oct 23, 2020, 3:37:00 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-services/utils/open-api/templates/index.html
r962 r964 611 611 System[i](); 612 612 } 613 System["JSON_STR"]=JSON.parse(tmpStr); 614 var forms = document.getElementsByClassName('needs-validation'); 615 // Loop over them and prevent submission 616 var validation = Array.prototype.filter.call(forms, function(form) { 617 form.addEventListener('submit', function(event) { 618 event.preventDefault(); 619 event.stopPropagation(); 620 if (form.checkValidity() === false) { 621 event.preventDefault(); 622 event.stopPropagation(); 623 alert('ok'); 624 }else{ 625 loadRequest(); 626 } 627 form.classList.add('was-validated'); 628 }, false); 629 }); 613 System["JSON_STR"]=JSON.parse(tmpStr); 614 var forms = document.getElementsByClassName('needs-validation'); 615 // Loop over them and prevent submission 616 var validation = Array.prototype.filter.call(forms, function(form) { 617 form.addEventListener('submit', function(event) { 618 event.preventDefault(); 619 event.stopPropagation(); 620 if (form.checkValidity() === false) { 621 event.preventDefault(); 622 event.stopPropagation(); 623 for(var i=0;i<System["JSON_STR"]["inputs"].length;i++){ 624 var cName=System["JSON_STR"]["inputs"][i]["id"].replace(/\./g,"_"); 625 var selector= 626 'input[name="input_value_'+cName+'"]:invalid,'+ 627 'select[name="input_value_'+cName+'"]:invalid'; 628 if(\$(selector).length>0){ 629 \$(selector).each(function(){ 630 \$(this).parent().parent().parent().parent().find(".btn").first().click(); 631 }); 632 console.log(System["JSON_STR"]["inputs"][i]["id"]); 633 } 634 } 635 }else{ 636 loadRequest(); 637 } 638 form.classList.add('was-validated'); 639 }, false); 640 }); 630 641 631 642 } … … 633 644 <hr> 634 645 <address>$openapi["openapi"]["rootUrl"]$(currentUrl).html</address> 635 <!-- hhmts start -->Last modified: Wed Oct 21 17:23:48CEST 2020 <!-- hhmts end -->646 <!-- hhmts start -->Last modified: Thu Oct 22 14:21:02 CEST 2020 <!-- hhmts end --> 636 647 </main> 637 648 #if $currentKey=="root"
Note: See TracChangeset
for help on using the changeset viewer.