{
    "mode": "perldoc",
    "parameter": "CGI::FormBuilder::Messages",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3AFormBuilder%3A%3AMessages/json",
    "generated": "2026-07-05T12:27:46Z",
    "synopsis": "use CGI::FormBuilder::Messages;\nmy $mesg = CGI::FormBuilder::Messages->new(\n$file || \\%hash || ':locale'\n);\nprint $mesg->jsinvalidtext;",
    "sections": {
        "NAME": {
            "content": "CGI::FormBuilder::Messages - Localized message support for FormBuilder\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use CGI::FormBuilder::Messages;\n\nmy $mesg = CGI::FormBuilder::Messages->new(\n$file || \\%hash || ':locale'\n);\n\nprint $mesg->jsinvalidtext;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module handles localization for FormBuilder. It is invoked by specifying the \"messages\"\noption to FormBuilder's \"new()\" method. Currently included with FormBuilder are several\ndifferent locales:\n\nEnglish (default)    enUS\nDanish               daDK\nGerman/Deutsch       deDE\nSpanish/Espanol      esES\nJapanese             jaJP\nNorwegian/Norvegian  noNO\nTurkish              trTR\nRussian              ruRU\n\nTo enable automatic localization that will detect the client's locale and use one of these\nincluded locales, simply turn on \"auto\" messages:\n\nmy $form = CGI::FormBuilder->new(messages => 'auto');\n\nOr, to use a specific locale, specify it as \":locale\"\n\n# Force Danish messages\nmy $form = CGI::FormBuilder->new(messages => ':daDK');\n\nIn addition to these included locales, you can completely customize your own messages. Each\nmessage that FormBuilder outputs is given a unique key. You can selectively override FormBuilder\nmessages by specifying a different message string for a given message key.\n\nTo do so, first create a file and give it a unique name. In this example we will use a shortened\nlocale as the suffix:\n\n# messages.en\n# FormBuilder messages for \"en\" locale\njsinvalidstart      %s error(s) were found in your form:\\n\njsinvalidend        Fix these fields and try again!\njsinvalidselect     - You must choose an option for the \"%s\" field\\n\n\nThen, specify this file to \"new()\".\n\nmy $form = CGI::FormBuilder->new(messages => 'messages.en');\n\nAlternatively, you could specify this directly as a hashref:\n\nmy $form = CGI::FormBuilder->new(\nmessages => {\njsinvalidstart  => '%s error(s) were found in your form:\\n',\njsinvalidend    => 'Fix these fields and try again!',\njsinvalidselect => '- Choose an option from the \"%s\" list\\n',\n}\n);\n\nAlthough in practice this is rarely useful, unless you just want to tweak one or two things.\n\nThis system is easy, and there are many many messages that can be customized. Here is a list of\nmessages, along with their default values:\n\nforminvalidinput          Invalid entry\nforminvalidcheckbox       Check one or more options\nforminvalidfile           Invalid filename\nforminvalidpassword       Invalid entry\nforminvalidradio          Choose an option\nforminvalidselect         Select an option from this list\nforminvalidtextarea       Please fill this in\nforminvaliddefault        Invalid entry\n\nforminvalidtext           %s error(s) were encountered with your submission.\nPlease correct the fields %shighlighted%s below.\n\nformrequiredtext          Fields that are %shighlighted%s are required.\n\nformconfirmtext           Success! Your submission has been received %s.\n\nformselectdefault         -select-\nformgrowdefault           Additional %s\nformotherdefault          Other:\nformresetdefault          Reset\nformsubmitdefault         Submit\n\njsnoscript                 Please enable JavaScript or use a newer browser.\njsinvalidstart            %s error(s) were encountered with your submission:\njsinvalidend              Please correct these fields and try again.\n\njsinvalidcheckbox         - Check one or more of the \"%s\" options\njsinvaliddefault          - Invalid entry for the \"%s\" field\njsinvalidfile             - Invalid filename for the \"%s\" field\njsinvalidinput            - Invalid entry for the \"%s\" field\njsinvalidmultiple         - Select one or more options from the \"%s\" list\njsinvalidpassword         - Invalid entry for the \"%s\" field\njsinvalidradio            - Choose one of the \"%s\" options\njsinvalidselect           - Select an option from the \"%s\" list\njsinvalidtextarea         - Please fill in the \"%s\" field\n\nmailconfirmsubject        %s Submission Confirmation\nmailconfirmtext           Your submission has been received %s, and will be processed shortly.\nmailresultssubject        %s Submission Results\n\nThe \"js\" tags are used in JavaScript alerts, whereas the \"form\" tags are used in HTML and\ntemplates managed by FormBuilder.\n\nIn some of the messages, you will notice a %s \"printf\" format. This is because these messages\nwill include certain details for you. For example, the \"jsinvalidstart\" tag will print the\nnumber of errors if you include the %s format tag. Of course, this is optional, and you can\nleave it out.\n\nThe best way to get an idea of how these work is to experiment a little. It should become\nobvious really quickly.\n",
            "subsections": []
        },
        "TRANSLATORS": {
            "content": "Foreign language translations were contributed by the following people:\n\nDanish translation (daDK)\nJonas Smedegaard\n\nGerman translation (deDE)\nThilo Planz\n\nSpanish translation (esES)\nFlorian Merges\n\nFrench translation (frFR)\nLaurent Dami\n\nJapanese translation (jaJP)\nToru Yamaguchi and Thilo Planz\n\nNorwegian translation (noNO)\nSteinar Fremme\n\nTurkish translation (trTR)\nRecai Oktaş\n\nThanks!\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "CGI::FormBuilder\n",
            "subsections": []
        },
        "REVISION": {
            "content": "$Id: Messages.pm 100 2007-03-02 18:13:13Z nwiger $\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Copyright (c) Nate Wiger <http://nateware.com>. All Rights Reserved.\n\nThis module is free software; you may copy this under the terms of the GNU General Public\nLicense, or the Artistic License, copies of which should have accompanied your Perl kit.\n",
            "subsections": []
        }
    },
    "summary": "CGI::FormBuilder::Messages - Localized message support for FormBuilder",
    "flags": [],
    "examples": [],
    "see_also": []
}