DevArt EichJS Extender Core

From DevArt Knowledgebase
Revision as of 06:17, 19 September 2025 by Daadmin (talk | contribs) (Created page with "HTTP EichJS is a comprehensive library that allows you to develop web applications using Vanilla JavaScript. == Info == * Developer: [https://www.devartsoftware.com DevArt Software Co.] * Contributors: Pathum Bandara Premaratne * Latest Version: v1.0.16 @2025-06-26 * URL: https://js.devartsoftware.com/devart/extender/main/v1.0/devart.extender.min.js == Methods == === ValidateFile === ValidateFile(FileControl, Rules, OnComplete); Validates upload file controller with...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

HTTP EichJS is a comprehensive library that allows you to develop web applications using Vanilla JavaScript.

Info

Methods

ValidateFile

ValidateFile(FileControl, Rules, OnComplete);
Validates upload file controller with the given validation rules.

Parameters

{Element} FileControl - File input control.
{Object[]} Rueles - Array of validation rules.
{Function} OnComplete - Callback function to be called on completion of validation. Parameter is an object with Success and Message properties.

Sample

ValidateFile(Uploader,
   [
       { Name: "size", Value: 1 }, //in MB
       { Name: "type", Value: "jpg,png,jpeg,gif" },
       { Name: "ratio", Value: "16:9" },
       { Name: "dimension-min", Value: { Width: 480, Height: 270 } },
       { Name: "dimension-max", Value: { Width: 1920, Height: 1080} }
   ],
   (Result) =>
   {
       let Lbl = document.getElementById("LblUploadMsg");
       
       if (!Result.Success)
       {
           Lbl.innerHTML = Result.Message;
           return;
       }
       
       UploadFile();
   });