Skip to main content

D365 portal form validation script with other script

 In your portal form you have form script which is based on your form input. If you also want add form validation in to same script you can use this sample code.


 $(document).ready(function(){  
 // Write your other form script code   
 // Client validation this will trigger during submit or next button for advance form    
 window.webFormClientValidate = function () {  
      // write your client validation logic  
      var assistenstd = parseFloat($('#proevt_assistenstd_discount').val())            
      var filePath = $('#AttachFile').val();  
      if(assistenstd>0){  
           if(filePath){  
                return true;  
           } else {  
                // Validation error  
                alert("Please upload document.");  
                return false;  
           }  
           }  
      };  
 });  


Comments