checkAttributeValue() (tick_24Validator Engine Only)

bool checkAttributeValue(int $flags, int $msgid, int $msgcat, string $attname, string $value1[, string $value2...]);

This is a simple function to check an attribute value and return false if there is a problem or true if all checks are passed.

$flags

1 - display a standard error message

2 - allow integer values (negative, positive, or 0)

4 - allow non-negative integer values (0 and positive values)

8 - allow positive integer values (positive values only)

NOTE: Use only 0 or 1 of the following flags: 2, 4, 8.

$msgid - the message ID to use if an error messages is generated; use -1 if not used or not applicable

$msgcat - the message category as an integer (see getMessageCategory() ); use -1 if not used or not applicable

$attname - the attribute name of the attribute value to check; if the attribute does not exist then the function returns true

$valuex - supply a list of valid attribute values; if the attribute value matches one of these values then the check is successful and the function returns true

This function is supported by CSE HTML Validator v16.9903 and later.

Example:

checkAttributeValue(1,2016072107,55,'data-ui-logo','true','false');
checkAttributeValue(1,2016072108,55,'data-info','true','false');