{"id":39986,"date":"2024-08-20T13:24:34","date_gmt":"2024-08-20T17:24:34","guid":{"rendered":"https:\/\/docs.gravityforms.com\/?p=39986"},"modified":"2024-11-07T10:19:09","modified_gmt":"2024-11-07T15:19:09","slug":"gform_checkbox_limit_exact_message","status":"publish","type":"post","link":"https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/","title":{"rendered":"gform_checkbox_limit_exact_message"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-description\">Description<\/h2>\n\n\n\n<p>Allows to modify the message displayed when a checkbox is limited to an number of choices.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-usage\">Usage<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( &#039;gform_checkbox_limit_exact_message&#039;, &#039;your_function_name&#039;, 10, 3 );\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-parameters\">Parameters<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>$message<\/strong><span style=\"font-size: 1rem;\">&nbsp;<\/span><a style=\"font-size: 1rem;\" href=\"https:\/\/docs.gravityforms.com\/string\">string<\/a><br><span style=\"font-size: 1rem;\">The message to filter<\/span>.<\/li>\n\n\n\n<li><strong>$number<\/strong> <a href=\"https:\/\/docs.gravityforms.com\/int\">int<\/a><br>The number of choices that must be selected.<\/li>\n\n\n\n<li><strong>$field<\/strong>&nbsp;<a href=\"https:\/\/docs.gravityforms.com\/integer\/\" target=\"_blank\" rel=\"noreferrer noopener\">integer<\/a><br>The field currently being processed.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-examples\">Examples<\/h2>\n\n\n\n<p>Add a custom message to the Exact Limit.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nadd_filter( &#039;gform_checkbox_limit_exact_message&#039;, &#039;exact_message&#039;, 10, 3 );\nfunction exact_message( $message, $number, $field ) {\n\treturn &#039;You must pick exactly &#039; . $number;\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-placement\">Placement<\/h2>\n\n\n\n<p>This code can be used in the <a href=\"https:\/\/developer.wordpress.org\/themes\/basics\/theme-functions\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">functions.php<\/a> file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.<\/p>\n\n\n\n<p>See also the PHP section in this article: <a href=\"https:\/\/docs.gravityforms.com\/where-do-i-put-this-code\/\" target=\"_blank\" rel=\"noreferrer noopener\">Where Do I Put This Code?<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-since\">Since<\/h2>\n\n\n\n<p>This filter was added in Gravity Forms 2.9.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-source-code\">Source Code<\/h2>\n\n\n\n<p>This filter is located in includes\/fields\/gf-field-choice.php<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Allows to modify the message displayed when a checkbox is limited to an number of choices.<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_autodraft_ids":[],"_sb_is_suggestion_mode":false,"_sb_show_suggestion_boards":false,"_sb_show_comment_boards":false,"_sb_suggestion_history":"","_sb_update_block_changes":"","_is_real_time_mode":false,"_realtime_collaborators":"","footnotes":"","jetpack_post_was_ever_published":false,"cf_checklist_status":[]},"categories":[12813],"tags":[],"class_list":["post-39986","post","type-post","status-publish","format-standard","hentry","category-other-fields","wpautop"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.7) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>gform_checkbox_limit_exact_message - Gravity Forms Documentation<\/title>\n<meta name=\"description\" content=\"Allows to modify the message displayed when a checkbox is limited to an number of choices.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"gform_checkbox_limit_exact_message\" \/>\n<meta property=\"og:description\" content=\"Allows to modify the message displayed when a checkbox is limited to an number of choices.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/\" \/>\n<meta property=\"og:site_name\" content=\"Gravity Forms Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2024-08-20T17:24:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-07T15:19:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/docs.gravityforms.com\/wp-content\/uploads\/2023\/08\/gf-docs-default-v3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"544\" \/>\n\t<meta property=\"og:image:height\" content=\"288\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Dario\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@gravityforms\" \/>\n<meta name=\"twitter:site\" content=\"@gravityforms\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dario\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/gform_checkbox_limit_exact_message\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/gform_checkbox_limit_exact_message\\\/\"},\"author\":{\"name\":\"Dario\",\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/#\\\/schema\\\/person\\\/acf2ff624683e2d7264ba969921fd50e\"},\"headline\":\"gform_checkbox_limit_exact_message\",\"datePublished\":\"2024-08-20T17:24:34+00:00\",\"dateModified\":\"2024-11-07T15:19:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/gform_checkbox_limit_exact_message\\\/\"},\"wordCount\":77,\"publisher\":{\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/#organization\"},\"articleSection\":[\"Other Fields\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/gform_checkbox_limit_exact_message\\\/\",\"url\":\"https:\\\/\\\/docs.gravityforms.com\\\/gform_checkbox_limit_exact_message\\\/\",\"name\":\"gform_checkbox_limit_exact_message - Gravity Forms Documentation\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/#website\"},\"datePublished\":\"2024-08-20T17:24:34+00:00\",\"dateModified\":\"2024-11-07T15:19:09+00:00\",\"description\":\"Allows to modify the message displayed when a checkbox is limited to an number of choices.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/gform_checkbox_limit_exact_message\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/docs.gravityforms.com\\\/gform_checkbox_limit_exact_message\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/gform_checkbox_limit_exact_message\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/docs.gravityforms.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"gform_checkbox_limit_exact_message\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/#website\",\"url\":\"https:\\\/\\\/docs.gravityforms.com\\\/\",\"name\":\"Gravity Forms Documentation\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/docs.gravityforms.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/#organization\",\"name\":\"Gravity Forms\",\"url\":\"https:\\\/\\\/docs.gravityforms.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/docs.gravityforms.com\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/gravity-forms-2020-logo-stacked.png\",\"contentUrl\":\"https:\\\/\\\/docs.gravityforms.com\\\/wp-content\\\/uploads\\\/2020\\\/01\\\/gravity-forms-2020-logo-stacked.png\",\"width\":392,\"height\":515,\"caption\":\"Gravity Forms\"},\"image\":{\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/gravityforms\",\"http:\\\/\\\/@gravityforms.com\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/docs.gravityforms.com\\\/#\\\/schema\\\/person\\\/acf2ff624683e2d7264ba969921fd50e\",\"name\":\"Dario\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b04dae864801947724ed88af0a96d38fc6068202143a3524df343d2858de9023?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b04dae864801947724ed88af0a96d38fc6068202143a3524df343d2858de9023?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b04dae864801947724ed88af0a96d38fc6068202143a3524df343d2858de9023?s=96&d=mm&r=g\",\"caption\":\"Dario\"},\"url\":\"https:\\\/\\\/docs.gravityforms.com\\\/author\\\/darion\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"gform_checkbox_limit_exact_message - Gravity Forms Documentation","description":"Allows to modify the message displayed when a checkbox is limited to an number of choices.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/","og_locale":"en_US","og_type":"article","og_title":"gform_checkbox_limit_exact_message","og_description":"Allows to modify the message displayed when a checkbox is limited to an number of choices.","og_url":"https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/","og_site_name":"Gravity Forms Documentation","article_published_time":"2024-08-20T17:24:34+00:00","article_modified_time":"2024-11-07T15:19:09+00:00","og_image":[{"width":544,"height":288,"url":"https:\/\/docs.gravityforms.com\/wp-content\/uploads\/2023\/08\/gf-docs-default-v3.png","type":"image\/png"}],"author":"Dario","twitter_card":"summary_large_image","twitter_creator":"@gravityforms","twitter_site":"@gravityforms","twitter_misc":{"Written by":"Dario","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/#article","isPartOf":{"@id":"https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/"},"author":{"name":"Dario","@id":"https:\/\/docs.gravityforms.com\/#\/schema\/person\/acf2ff624683e2d7264ba969921fd50e"},"headline":"gform_checkbox_limit_exact_message","datePublished":"2024-08-20T17:24:34+00:00","dateModified":"2024-11-07T15:19:09+00:00","mainEntityOfPage":{"@id":"https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/"},"wordCount":77,"publisher":{"@id":"https:\/\/docs.gravityforms.com\/#organization"},"articleSection":["Other Fields"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/","url":"https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/","name":"gform_checkbox_limit_exact_message - Gravity Forms Documentation","isPartOf":{"@id":"https:\/\/docs.gravityforms.com\/#website"},"datePublished":"2024-08-20T17:24:34+00:00","dateModified":"2024-11-07T15:19:09+00:00","description":"Allows to modify the message displayed when a checkbox is limited to an number of choices.","breadcrumb":{"@id":"https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/docs.gravityforms.com\/gform_checkbox_limit_exact_message\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/docs.gravityforms.com\/"},{"@type":"ListItem","position":2,"name":"gform_checkbox_limit_exact_message"}]},{"@type":"WebSite","@id":"https:\/\/docs.gravityforms.com\/#website","url":"https:\/\/docs.gravityforms.com\/","name":"Gravity Forms Documentation","description":"","publisher":{"@id":"https:\/\/docs.gravityforms.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/docs.gravityforms.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/docs.gravityforms.com\/#organization","name":"Gravity Forms","url":"https:\/\/docs.gravityforms.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/docs.gravityforms.com\/#\/schema\/logo\/image\/","url":"https:\/\/docs.gravityforms.com\/wp-content\/uploads\/2020\/01\/gravity-forms-2020-logo-stacked.png","contentUrl":"https:\/\/docs.gravityforms.com\/wp-content\/uploads\/2020\/01\/gravity-forms-2020-logo-stacked.png","width":392,"height":515,"caption":"Gravity Forms"},"image":{"@id":"https:\/\/docs.gravityforms.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/gravityforms","http:\/\/@gravityforms.com"]},{"@type":"Person","@id":"https:\/\/docs.gravityforms.com\/#\/schema\/person\/acf2ff624683e2d7264ba969921fd50e","name":"Dario","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b04dae864801947724ed88af0a96d38fc6068202143a3524df343d2858de9023?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b04dae864801947724ed88af0a96d38fc6068202143a3524df343d2858de9023?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b04dae864801947724ed88af0a96d38fc6068202143a3524df343d2858de9023?s=96&d=mm&r=g","caption":"Dario"},"url":"https:\/\/docs.gravityforms.com\/author\/darion\/"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pdGaEa-aoW","_links":{"self":[{"href":"https:\/\/docs.gravityforms.com\/wp-json\/wp\/v2\/posts\/39986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.gravityforms.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.gravityforms.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.gravityforms.com\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.gravityforms.com\/wp-json\/wp\/v2\/comments?post=39986"}],"version-history":[{"count":3,"href":"https:\/\/docs.gravityforms.com\/wp-json\/wp\/v2\/posts\/39986\/revisions"}],"predecessor-version":[{"id":40116,"href":"https:\/\/docs.gravityforms.com\/wp-json\/wp\/v2\/posts\/39986\/revisions\/40116"}],"wp:attachment":[{"href":"https:\/\/docs.gravityforms.com\/wp-json\/wp\/v2\/media?parent=39986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.gravityforms.com\/wp-json\/wp\/v2\/categories?post=39986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.gravityforms.com\/wp-json\/wp\/v2\/tags?post=39986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}