validity
Gets a ValidityState object that contains detailed information about the validity states of the file to upload.
Type:
NAME
TYPE
DESCRIPTION
true
if the file's custom validity message has been set to a non-empty string.
true
if the file to upload meets all validations.
true
if a file is required, and either no file has been selected, or a file has been selected but not uploaded.
true
if a file has been selected but it is too large. Maximum allowed file sizes are listed here.
true
if a file has been selected but the file's type is not supported. Supported file types are listed here.
true
if a file is required but no file has been selected.
true
if the text input element's value does not match its type when the type is email or url.
true
if the element's value does not match its pattern validation.
true
if the length of the element's value is smaller than its minlength
property.
true
if a text input element's numeric value is defined as a whole number but a decimal number is entered.
true
if the element's value cannot be converted to a value.
true
if the number of files selected exceeds the limit defined in the fileLimit
property.
true
if the element's time value is not a valid time.
true
if the element's date value is not a valid date.
Related Content:
Was this helpful?
Log ValidityState info
1let validityObj = $w("#myUploadFile").validity;23let customError = validityObj.customError; // true4let valid = validityObj.valid; // false5let fileNotUploaded = validityObj.fileNotUploaded; // false6let fileSizeExceedsLimit = validityObj.fileSizeExceedsLimit; // false7let fileTypeNotAllowed = validityObj.fileTypeNotAllowed; // false8let valueMissing = validityObj.valueMissing; // false