runProgram() (tick_24Validator Engine Only)

int runProgram(int $programnum[, int $programnum...]);

Runs a built-in "tag name program". Built-in tag name programs help to improve performance because the program is precompiled and can be written more efficiently.

$programnum

1 - run built-in text tag name program and generate error message(s) if the text is not allowed where it's at

2 - run built-in end tag name program for the "p" element, returns 0 if successful or a negative number if an error occurs (OBSOLETE in v14.00)

3 - run for "alt" attributes to check for alt text containing only white space characters and to generate appropriate accessibility messages if so; as of v11.0111 also displays a WCAG 2.0 accessibility message if the alt text is empty or null and there is no "title" attribute (New v5.9910)

4 - run in an attribute program to check the attribute's value for misspelled words (New v4.5091)

5 - run for "alt" attributes to check alt text for beginning with inappropriate strings like "click here", "go to", "image of", and "link to" and to generate appropriate accessibility messages if so (New v5.9910)

6 - run for "alt" attributes to check for inappropriate alt text like "image", "picture", and "alt text" and to generate the appropriate accessibility messages if so (New v5.9910); also checks for common image file extensions like ".jpg"; in v15.99+ also generates an SEO message if search engine messages are enabled (New v7.9911)

7 - run for "alt" attributes to check for alt text longer more than 75 characters and to generate the appropriate accessibility messages if so (New v5.9910); also checks for alt text shorter than 8 characters (New v7.9910)

8 - run a tag name program that checks if the element's use is OK with regard to its use in strict HTML/XHTML documents; a warning message will be displayed if the tag should not be used because the document was declared as being a strict HTML 4 or XHTML document (New v4.5093)

9 - run for elements that provide programmatic functions (like "applet", "script", and "object") and generate appropriate accessibility messages about making sure that the page is usable without these these programmatic functions (New v5.9910)

10 - run in an attribute or attribute value program for device-dependent event handler attributes like "onmouseout" and "onmouseover" and generate appropriate accessibility messages about using logical event handlers instead; added WCAG 2.0 messages in v11.0111 (New v5.9910)

11 - run for "frame" and "iframe" elements to check the "title" attribute for inappropriate titles and to generate appropriate accessibility messages (New v5.9910)

12 - run for "a" element to check the "href" attribute for "javascript:" and to generate appropriate accessibility messages (New v5.9910)

13 - displays appropriate accessibility style sheet messages when a style sheet is used (New v5.9910)

14 - displays appropriate accessibility messages about using style sheets (CSS) instead of presentational HTML/XHTML markup (New v5.9910)

15 - displays an accessibility message about ordering heading elements properly (the message is displayed only once) (New 20030130)

16 - run a tag name program that checks if the attribute's use is OK with regard to its use in strict HTML/XHTML documents; a warning message will be displayed if the attribute should not be used because the document was declared as being a strict HTML 4 or XHTML document (New v4.5110)

17 - run in the "coords" attribute tag name program to check the value of the "coords" attribute (New v5.9910)

18 - run in "headers" attribute program to check the "headers" attribute value; table cell IDs must be stored in an array named "$tablecellidusedarray" (New v5.9910)

19 - run in the "accesskey" attribute program(s) to check for duplicate accesskey values (New v5.9910)

20 - run in the end validation program to check for the use of labels with form controls such as "input", "select", and "textarea" (New v5.9930)

21 - run in tag name programs to place the current tag's attributes and attribute values in the node structure because they may be needed later (New v5.9930)

22 - checks $contentvalue for a valid robot meta tag content value; sets $runprogram22result with results (an empty string if OK, or other if not); see also 94, 95 (New v6.0100)

23 - run in tag name end programs (like for the "a" tag) to generate warning messages when the tag does not contain any text (special treatment for "a" tags: works only for "a" tags with the "href" attribute and that don't contain tags like "img") (New v6.4930)

24 - run in tag name programs to check attribute values (for attributes like "width", "height", "hspace", and "vspace") for CSS length units and print an appropriate message if CSS length units are improperly used in HTML attribute values (New v6.4930)

25 - run in tag name programs to check for HTML 4 attributes incorrectly being used in XHTML documents (like the "for" and "event" attributes for the "script" element) (New v6.4930)

26 - run in attribute programs for attributes that contain scripts (such as event attributes like "onclick" and "onmouseover"); checks the attribute value for mismatched single or double quotes; as of v11.0111 also generates a message if the default scripting language was not specified, an HTML5 document is not assumed, and category 17 is active; as of v11.9915 also checks polyglot documents for document.write() and document.writeln() (New v6.4940)

27 - run for elements that may be in a form to check to see if the element has a "name" attribute value that may cause problems/conflicts with JavaScript, such as "action", "method", "name", "target", etc. (New v6.4940)

28 - run in the start validation program (New v6.4950)

29 - run in the end tag programs for elements that may only contain inline elements when the document is a strict or XHTML 1.1 document. NEW for HTML5: Can also be run to check for non-phrasing content in the element (v10.9922), but prefer checkTagContents(3,1). Special handling for the "address" and "caption" elements (v11.9951). (New v6.5200)

30 - run in the end tag programs for elements that may only contain block elements when the document is a strict or XHTML 1.1 document. (New v6.5200)

31 - run in the "tabindex" attribute program(s) to check for duplicate tabindex values (New v6.5200)

32 - adds $value (excluding "#") to $internallinksarray and increments $numinternallinks if $value is not already in the array (New v4.5200)

33 - run in the "a" open program to check for an adjacent "a" tag with only whitespace between the current "a" tag and the adjacent "a" tag (accessibility checking) (New v6.5300)

34 - run in the "table" end tag to check the table structure by checking that each table row has the same number of cells (works even when "colspan" and "rowspan" attributes are used)

35 - run in the end validation program to check for block level elements contained in inline elements; runs if flag 28 or 30 is set; flag 30 is specific for finding block level elements contained in a "font" element (New v6.9931)

36 - run in the end tag program for empty elements like "br", "embed", "img", "param", "wbr", etc.; generates a warning message if the end tag for an empty element is encountered in an XHTML document (New v6.9941)

37 - add any refresh links contained in a meta refresh tag to the list of document links; in v8.9910 and above, also sets $runprogram37url to the link to refresh to (New v7.0005)

38 - run in the end validation program to generate warning messages for tags that don't contain text (phrasing content) but probably should (like "b", "i", "label", header tags, etc); also generates a message for empty "p" tags (New v7.9910)

39 - run in the end validation program to display a comment message that lists ignored CSS properties (if any) (New v7.9910)

40 - check the value of the "id" attribute for valid characters; generates special messages for values beginning with _asp, __asp, or underscores (New v7.9914)

41 - check image dimensions (if able) and spacer images and generate a message if actual image dimensions are different from that specified with the "height" and/or "width" attributes; in v9.0192+ generates a warning if one "height" or "width" attribute value is a percent and the other is not; in v9.9931+ also checks for spacer images if accessibility checking is enabled (New v8.9910)

42 - use in an end tag program to check the text contents of the element being closed for preceding and ending space characters (New v8.9910)

43 - run in "option" tag program to check the "value" attribute's value for a possible link to check with the link checker (New v8.9910)

44 - run in an attribute program to check the attribute value for tags and generate a warning if tags are found (New v9.0191)

45 - run in the end validation program to generate CLF 2.0 messages if CLF 2.0 checking is enabled (New v9.9910)

46 - run in the heading start tag programs (like "h1", "h2", etc) to check heading order; increments $numheadingused (New v9.9910)

47 - run to generate a CLF 2.0 header order error message if CLF 2.0 checking is enabled (called from programnum 46) (New v9.9910)

48 - run in the "html" end tag to check for CLF 2.0 issues if CLF 2.0 checking is enabled (New v9.9910)

49 - run in the "title" end tag to support CLF 2.0 checking, requires $gvi23temp (New v9.9910)

50 - run in the "html" start tag program to set some language variables if a language is specified (currently used only for CLF 2.0 support) (New v9.9910)

51 - run in the "body" start tag to do some color contrast checking; sets $bodybgcolor if "bgcolor" attribute used; (New v10.0145) if accessibility checking is on then also generates an error or warning message if a "body" color attribute is used without using all of the color attributes (New v9.9910)

52 - run in the end validation program to check for links that open in new windows if accessibility checking is on (New v9.9910)

60 - run for elements that are obsolete in HTML5; generates flag 121 messages (New v9.9913)

61 - run for elements that may contain attributes that are obsolete in HTML5; generates flag 122 messages; v10.9923+ also checks "embed" for namespace-less attribute names with uppercase characters; v11.0114 also checks for presentational attributes if WCAG 2.0 checking is enabled (New v9.9913)

62 - run for new HTML5 elements (elements newly added in HTML5); also runs program 512; see also 68 for HTML 5.1 (New v9.9913)

63 - run for new HTML5 attributes (attributes newly added in HTML5); not necessary to run for attributes that are only used in new HTML5 elements because program 62 is run; generates HTML5 compatibility messages if flag 123 is set; see also 69 for HTML 5.1 (New v9.9913)

64 - if tag name program flag 11 is set, plays a sound according to how many errors and warnings (if any) are present (New v5.00)

65 - run in attribute programs for "old" (HTML 4 or older) attributes that are set to new HTML5 values (internal use only: use flag 1 to generate an HTML5 compatibility message if flag 123 is set); see also 96 for HTML 5.1 (New v9.9914)

66 - check the alt and title text to see if they are the same and display a warning message if so (New v9.9933)

67 - run for elements that may contain attributes that are deprecated in HTML4; generates flag 9 messages for HTML4 transitional documents (New v10.0020)

68 - run for new HTML 5.1 elements (elements newly added in HTML 5.1); also runs program 512; see also 62 for HTML5 (New v12.0113)

69 - run for new HTML 5.1 attributes (attributes newly added in HTML 5.1); not necessary to run for attributes that are only used in new HTML 5.1 elements because program 68 is run; generates HTML 5.1 compatibility messages if flag 131 is set; see also 63 for HTML5 (New v12.0113)

70 - run for elements that are "labelable" (may be associated with a label) to add the element's "id" value to the labelableidarray array (New v9.9914)

71 - run in the end tag program to check to following: (New v9.9914)

that any IDs specified using the "command" attribute in "command" elements are existent command IDs (both $commandcommandattused and $commandidarray must be defined) (New v11.9926)

that any IDs specified using the "for" attribute in "label" elements are existent (and labelable) IDs ($labelforattused must be defined)

that any IDs specified with the "form" attribute are form IDs ($formattused must be defined)

that any IDs specified using the "list" attribute in "input" elements are datalist IDs ($listattused must be defined)

72 - run in the tag name program for "input" to check that the used attributes apply based on the input type; before running this program, $inputtype should be set to a number that represents the input type

73 - run in the end tag program for "progress" (New v9.9914)

74 - run in the end tag program for "meter" (New v9.9914)

75 - run in the end validation program to generate additional WCAG 2.0 messages (New v9.9927)

76 - run for certain tags, like "img" and "input", to add links and new "user link comments" to the $links array for link checking (New v9.9927); if checking a securely delivered (via HTTPS) page and flag 126 is enabled, also checks the content links to see if they are insecure and generates a warning message if so (New v10.0046)

77 - run in the open tag name program for "table" tags to set $islayouttable based on whether the table appears to be a layout table (New v9.9930)

78 - run for elements like "link" and "script" to check (if flag 126 is enabled) any content links that may be insecure, and if so, generate warning messages if the insecure content is linked to from a page that is presumed to be securely delivered via HTTPS (New v10.0046)

79 - run in the start tag program for "a" to quickly set the following: $accesskeyindex, $altindex, $hrefindex, $hrefvalue, $idindex, $mailtohref, $nameindex, $onclickindex, $selectedindex; sets to 0: $nameidok; increments the following: $aaccesskeyused (if $accesskeyindex>0), $atagused, $mailtotipmsg (if $mailtohref==true), $selectedbodyusedmessage (if $selectedindex>0); adds the value of "href" (if exists) to the list of links; runs program 84 if the value of "href" appears to be an internal link; in v15.00+ increments $atagusedwithrelnofollow if has "rel" attribute with "nofollow" and search engine messages are enabled (New v10.0210)

80 - sets $idattused based on whether $value is one of the array elements of the $idattusedarray (uses case-insensitive compares) (New v10.0210)

81 - run in the end tag program for "menu" to check the children to HTML5 spec (New v10.9923)

82 - run in the end tag program for "dl" to check the children to HTML5 spec (New v10.9923)

83 - run in the end tag program for "figure" to check the children (New v10.9923)

84 - run in an start tag, attribute or attribute value program to do the preparation that is needed to check the attribute's value for valid element ID references; if run in a start tag program, then $p84_attindex should be set with the attribute index of the attribute whose value contains ID references (New v10.9926)

85 - for internal use only; do not use

86 - run in the "class" attribute program for additional checks on the value; increments $classattusedcount in v14.00+ (New v11.0043)

87 - run in the end tag program for "table" to check the IDs of any "headers" attributes used in "td" or "th" elements (New v11.0103)

88 - run in an attribute or attribute value program for device-independent event handler attributes like "onblur" and "onfocus" and generate appropriate accessibility messages about also using device-dependent event handlers (New v11.9911)

89 - run in a start tag program to see if any sibling tags "exactly" match the current tag and if so then return 1, else return 0; if returns 1, then sets $rp89['line'] with the line number of the matching tag; performs case-sensitive compares of tag names, attribute names, and attribute values, but the order of the attributes does not matter; may need to use runProgram(21) (New v12.0027)

90 - sets $idattused based on whether $value is one of the array elements of the $idattusedarraycase (uses case-sensitive compares) and enables faster checking of "id" values when $idattusedarraycase and $idattusedarraynocase string sets are used (New v12.0106)

new in v14.0106: changed to case-sensitive and sets $idattusednocase to true or false if there is a case-insensitive match

new in v16.0306: if $idattused is set to true then also sets $idattused_extrainfo with additional information (if available) like " in a "p" tag that starts in line 17" or an empty string if no additional information is available

91 - for internal use only; do not use

92 - run for the "input" element to check if the value of "max" is less than the value of "min" where these attributes are applicable (requires $inputtype be set)  (New v14.00)

94 - like 22 but specific for "googlebot"; see also 22, 95 (New v14.00)

95 - like 22 but for "X-Robots-Tag" HTTP headers which can optionally specify a user-agent before the directives; see also 22, 94 (New v14.00)

96 - run in attribute programs for "old" (HTML 5 or older) attributes that are set to new HTML 5.1 values; see also 65 for HTML5 (New v14.00)

97 - run in attribute programs for "old" (HTML 5 or older) attributes that are set to new HTML 5.1 values and generate an HTML 5.1 compatibility message if flag 131 is set (New v14.00)

98 - check the "srcset" attribute (New v14.0106)

100 - run in the attribute name program for all AngularJS attributes (like those beginning with "ng-"); increments $numAngularJSattusedcount and generates an error if in standards compliant mode and the attribute name does not begin with "data-" (New v14.9910)

101 - reserved

102 - run in the attribute name program for the "role" attribute; performs additional checking of the ARIA role attribute value: that it is not set to the default; requires $roletype to already be set (and also, as of v16.0305, $rolename for support of multiple role values specified in the "role" attribute) (New v15.9900)

103 - generate an error message if accessibility checking is enabled and any "aria*" attributes are used (New v15.9916)

104 - run in the attribute program for all "aria*" attributes to perform (if accessibility checking is enabled) additional testing to detect potential incorrect uses of the attribute; returns 1 if an error message was generated (New v15.9916)

128 - program to handle validation modes (New v5.00)

256 - run in onConfigLoad() function (do not use; private use only) (New v5.00)

257 - run in onConfigLoad() function to set default flag descriptions (New v9.9910)

258 - like 256,  but for newer config files (>=201203050) (do not use; private use only) (New v11.0111)

512 - run for non-XHTML 1.1 and non-HTML 4.0x strict tags (no effect in HTML5+/XHTML5+ documents) (New v5.02)

1024 - run for XHTML 1.0 strict, XHTML 1.1 and HTML 4.0x strict tags that may contain non-XHTML 1.0 strict, non-XHTML 1.1 or non-HTML 4.0x strict attributes (New v5.02)

2048 - run in the attribute program for non-XHTML 1.1 and non-HTML 4.0x attributes when the attribute's category is still enabled so the attribute would otherwise be treated as valid when it's not valid; has no effect on HTML5 and above documents (New v5.4930)

4096 - run in the tag name end program for the "a" element that checks to see if the contents (the link text) is something like "click here", if so, displays a style message; also checks for Internet addresses (like http://www.domain.com) in link descriptions and generates a style message if found because readers may try to pronounce them; in v15.99+ also generates an SEO message if search engine messages are enabled (New v5.9920)

8192 - generate an error message if the tag is nested within itself; use in a tag name start program (New v5.4930)

16384 - check for "height" and "width" attributes that have percents as values and display a message about potential issues (New v5.4940)

32768 - for end tag name programs; generates a warning message if the contents of the tag does not begin with <!--; for inline scripts, generates a tip message to avoid them (New v10.0125); good to run for the "style" and "script" tag name end programs (New v5.4940)

65536 - run for tags that might contain deprecated XHTML attributes (New v5.4940)

131072 - run for tags that must be contained in an inline or block element in strict XHTML 1.0, XHTML 1.1, or XHTML Basic documents (New v5.4950)

262144 - run for attributes that may have browser specific color values (like UI color names); displays a message about them (New v5.5000)

524288 - run to check "width" attributes that specify widths greater than 100% and to display compatibility messages about using widths greater than 100% (New v5.5100)

1048576 - run to check "src" attributes that specify BMP images (with a .bmp file extension) and to display a message about BMP compatibility if a BMP image is specified (New v5.5100); as of v7.9910, displays a compatibility message for PNG images; as of v10.0032, displays a recommendation message for PNG images if ".gif" is found in the "src" attribute; as of v10.0146, displays an accessibility message if accessibility checking is enabled and ".gif" is found in the "src" attribute

Returns 0 if $programnum is unknown or HTML Validator doesn't know how to handle it. An error message will not be generated (to improve backward compatibility).

Do not use the runProgram() function unless you completely understand what you are doing.