{"id":2323,"date":"2016-03-04T16:13:39","date_gmt":"2016-03-04T21:13:39","guid":{"rendered":"https:\/\/www.bu.edu\/scnc\/?page_id=2323"},"modified":"2022-08-11T14:50:55","modified_gmt":"2022-08-11T18:50:55","slug":"gluten","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/scnc\/forms\/gluten\/","title":{"rendered":"Gluten &#038; Nut Free Pantry Request"},"content":{"rendered":"<p><noscript><\/p>\n<div class=\"noscriptmsg\"> You don&#8217;t have JavaScript enabled. Please <a href=\"http:\/\/www.bu.edu\/tech\/support\/browsers\/enable-cookies-and-javascript\/\">enable JavaScript<\/a> in your browser settings and try link again.<\/p>\n<style>\n\t\t#scnc_form { display:none; }\n\t<\/style>\n<\/div>\n<p><\/noscript><br \/>\n<script>\r\n    \/\/ JSFormValidation.js\r\n    \/*\r\n     * Run init() after the page is loaded\r\n     *\/\r\n    window.onload = init;\r\n\r\n    \/*\r\n     * Initialization\r\n     *\/\r\n    function init() {\r\n        \/\/ Bind \"onsubmit\" event handler to the \"submit\" button\r\n        document.getElementById(\"scnc_form\").onsubmit = validateForm;\r\n        \/\/ Bind \"onclick\" event handler to \"reset\" button\r\n        document.getElementById(\"btnReset\").onclick = clearForm;\r\n        \/\/ Set initial focus\r\n        document.getElementById(\"first_name\").focus();\r\n    }\r\n\r\n    \/*\r\n     * The \"onsubmit\" event handler to validate the input fields.\r\n     *\r\n     * Most of the input validation functions take 3 arguments:\r\n     *   inputElm: Input element to be validated.\r\n     *   errMsg: the error message to be displayed if validation fails.\r\n     *   errElm: to place the error message\r\n     *\r\n     * @param theForm: the form to be validated\r\n     *\/\r\n    function validateForm(theForm) {\r\n        with(theForm) {\r\n            \/\/ return false would prevent default submission\r\n            return (isNotEmpty(first_name, \"Please enter your first name.\", elmfirst_nameError) && isNotEmpty(last_name, \"Please enter your last name.\", elmlast_nameError) && isNumeric(buid, \"Please enter your  8-digit Boston University ID (after U).\", elmbuidError) && isLengthMinMax(buid, 8, 8, \"Please enter your 8-digit BU ID after U.\", elmbuidError) && isValidEmail(email, \"Enter a valid email.\", elmemailError) && isChecked(\"reason_for_access\", \"Please check the reason for access request.\", elmreason_for_accessError) \r\n            );\r\n        }\r\n    }\r\n\r\n    \/*\r\n     * Helper function, to be called after validation, to show or clear\r\n     *   existing error message, and to set focus to the input element\r\n     *   for correcting error.\r\n     * If isValid is false, show the errMsg on errElm, and place the\r\n     *   focus on the inputElm for correcting the error.\r\n     * Else, clear previous errMsg on errElm, if any.\r\n     *\r\n     * @param isValid (boolean): flag indicating the result of validation\r\n     * @param errMsg (string)(optional): error message\r\n     * @param errElm (object)(optional): if isValid is false, show errMsg; else, clear.\r\n     * @param inputElm (object)(optional): set focus to this element,\r\n     *        if isValid is false\r\n     *\/\r\n    function postValidate(isValid, errMsg, errElm, inputElm) {\r\n        if (!isValid) {\r\n            \/\/ Show errMsg on errElm, if provided.\r\n            if (errElm !== undefined && errElm !== null && errMsg !== undefined && errMsg !== null) {\r\n                errElm.innerHTML = errMsg;\r\n            }\r\n            \/\/ Set focus on Input Element for correcting error, if provided.\r\n            if (inputElm !== undefined && inputElm !== null) {\r\n                inputElm.classList.add(\"errorBox\"); \/\/ Add class for styling\r\n                inputElm.focus();\r\n            }\r\n        } else {\r\n            \/\/ Clear previous error message on errElm, if provided.\r\n            if (errElm !== undefined && errElm !== null) {\r\n                errElm.innerHTML = \"\";\r\n            }\r\n            if (inputElm !== undefined && inputElm !== null) {\r\n                inputElm.classList.remove(\"errorBox\");\r\n            }\r\n        }\r\n    }\r\n\r\n    \/*\r\n     * Validate that input value is not empty.\r\n     *\r\n     * @param inputElm (object): input element\r\n     * @param errMsg (string): error message\r\n     * @param errElm (object): element to place error message\r\n     *\/\r\n    function isNotEmpty(inputElm, errMsg, errElm) {\r\n        var isValid = (inputElm.value.trim() !== \"\");\r\n        postValidate(isValid, errMsg, errElm, inputElm);\r\n        return isValid;\r\n    }\r\n\r\n    \/* Validate that input value contains one or more digits *\/\r\n    function isNumeric(inputElm, errMsg, errElm) {\r\n        var isValid = (inputElm.value.trim().match(\/^\\d+$\/) !== null);\r\n        postValidate(isValid, errMsg, errElm, inputElm);\r\n        return isValid;\r\n    }\r\n\r\n    \/* Validate that input value contains only one or more letters *\/\r\n    function isAlphabetic(inputElm, errMsg, errElm) {\r\n        var isValid = (inputElm.value.trim().match(\/^[a-zA-Z]+$\/) !== null);\r\n        postValidate(isValid, errMsg, errElm, inputElm);\r\n        return isValid;\r\n    }\r\n\r\n    \/* Validate that input value contains one or more digits or letters *\/\r\n    function isAlphanumeric(inputElm, errMsg, errElm) {\r\n        var isValid = (inputElm.value.trim().match(\/^[0-9a-zA-Z]+$\/) !== null);\r\n        postValidate(isValid, errMsg, errElm, inputElm);\r\n        return isValid;\r\n    }\r\n\r\n    \/* Validate that input value length is between minLength and maxLength *\/\r\n    function isLengthMinMax(inputElm, minLength, maxLength, errMsg, errElm) {\r\n        var inputValue = inputElm.value.trim();\r\n        var isValid = (inputValue.length >= minLength) && (inputValue.length <= maxLength);\r\n        postValidate(isValid, errMsg, errElm, inputElm);\r\n        return isValid;\r\n    }\r\n\r\n    \/\/ Validate that input value is a valid email address\r\n    function isValidEmail(inputElm, errMsg, errElm) {\r\n        var isValid = (inputElm.value.trim().match(\r\n            \/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$\/) !== null);\r\n        postValidate(isValid, errMsg, errElm, inputElm);\r\n        return isValid;\r\n    }\r\n\r\n    \/*\r\n     * Validate that a selection is made (not default of \"\") in <select> input\r\n     *\r\n     * @param selectElm (object): the <select> element\r\n     *\/\r\n    function isSelected(selectElm, errMsg, errElm) {\r\n        \/\/ You need to set the default value of <select>'s <option> to \"\".\r\n        var isValid = (selectElm.value !== \"\"); \/\/ value in selected <option>\r\n        postValidate(isValid, errMsg, errElm, selectElm);\r\n        return isValid;\r\n    }\r\n\r\n    \/*\r\n     * Validate that one of the checkboxes or radio buttons is checked.\r\n     * Checkbox and radio are based on name attribute, not id.\r\n     *\r\n     * @param inputName (string): name attribute of the checkbox or radio\r\n     *\/\r\n    function isChecked(inputName, errMsg, errElm) {\r\n        var elms = document.getElementsByName(inputName);\r\n        var isChecked = false;\r\n        for (var i = 0; i < elms.length; ++i) {\r\n            if (elms[i].checked) {\r\n                isChecked = true;\r\n                break;\r\n            }\r\n        }\r\n        postValidate(isChecked, errMsg, errElm, null); \/\/ no focus element\r\n        return isChecked;\r\n    }\r\n\r\n    \/\/ Validate password, 6-8 characters of [a-zA-Z0-9_]\r\n    function isValidPassword(inputElm, errMsg, errElm) {\r\n        var isValid = (inputElm.value.trim().match(\/^\\w{6,8}$\/) !== null);\r\n        postValidate(isValid, errMsg, errElm, inputElm);\r\n        return isValid;\r\n    }\r\n\r\n    \/*\r\n     * The \"onclick\" handler for the \"reset\" button to clear the display,\r\n     * including the previous error messages and error box.\r\n     *\/\r\n    function clearForm() {\r\n        \/\/ Remove class \"errorBox\" from input elements\r\n        var elms = document.querySelectorAll('.errorBox'); \/\/ class\r\n        for (var i = 0; i < elms.length; i++) {\r\n            elms[i].classList.remove(\"errorBox\");\r\n        }\r\n\r\n        \/\/ Remove previous error messages\r\n        elms = document.querySelectorAll('[id$=\"Error\"]'); \/\/ id ends with Error\r\n        for (var i = 0; i < elms.length; i++) {\r\n            elms[i].innerHTML = \"\";\r\n        }\r\n\r\n        \/\/ Set initial focus\r\n        document.getElementById(\"first_name\").focus();\r\n    }\r\n<\/script><\/p>\n<form action=\"https:\/\/ssl.datamotion.com\/form2.aspx\" method=\"post\" id=\"scnc_form\" onSubmit=\"return validateForm()\">\n\t<input type=\"hidden\" name=\"txtto\" value=\"scdining@bu.edu\" \/><br \/>\n\t<input type=\"hidden\" name=\"txtsubject\" value=\"Gluten Free Pantry Request\" \/><br \/>\n\t<input type=\"hidden\" name=\"txtDone\" value=\"https:\/\/www.bu.edu\/scnc\/wp-assets\/gluten\/thanks\/index.html\" \/><\/p>\n<fieldset>\n<legend class=\"secure-lock\">BU Student Gluten &amp; Nut Free Pantry Request Form<\/legend>\n<div>\n\t\t\t<label for=\"first_name\">First Name: <em class=\"required\">*<\/em><\/label><br \/>\n\t\t\t<input name=\"first_name\" id=\"first_name\" type=\"text\" \/>\n\t\t<\/div>\n<div id=\"elmfirst_nameError\" class=\"errorMsg\">&nbsp;<\/div>\n<div>\n\t\t\t<label for=\"last_name\">Last Name: <em class=\"required\">*<\/em><\/label><br \/>\n\t\t\t<input name=\"last_name\" id=\"last_name\" type=\"text\" \/>\n\t\t<\/div>\n<div id=\"elmlast_nameError\" class=\"errorMsg\">&nbsp;<\/div>\n<div>\n\t\t\t<label for=\"buid\">BUID: <em class=\"required\">*<\/em><\/label><br \/>\n\t\t\tU<br \/>\n\t\t\t<input name=\"buid\" id=\"buid\" type=\"text\" maxlength=\"8\" \/>\n\t\t<\/div>\n<div id=\"elmbuidError\" class=\"errorMsg\">&nbsp;<\/div>\n<div>\n\t\t\t<label for=\"email\">Email: <em class=\"required\">*<\/em><\/label><br \/>\n\t\t\t<input name=\"email\" id=\"email\" type=\"text\" \/>\n\t\t<\/div>\n<div id=\"elmemailError\" class=\"errorMsg\">&nbsp;<\/div>\n<fieldset>\n<legend>Reason for Access Request: <em class=\"required\">*<\/em><\/legend>\n<div>\n\t\t\t\t<label for=\"reason_for_access_celiac\"><br \/>\n\t\t\t\t\t<input name=\"reason_for_access\" id=\"reason_for_access_celiac\" type=\"radio\" value=\"Celiac Disease\" \/><br \/>\n\t\t\t\t\tCeliac Disease<\/label>\n\t\t\t<\/div>\n<div>\n\t\t\t\t<label for=\"reason_for_access_gluten_intolerance\"><br \/>\n\t\t\t\t\t<input name=\"reason_for_access\" id=\"reason_for_access_gluten_intolerance\" type=\"radio\" value=\"Gluten Intolerance\" \/><br \/>\n\t\t\t\t\tGluten Intolerance<\/label>\n\t\t\t<\/div>\n<div>\n\t\t\t\t<label for=\"reason_for_access_fodmap\"><br \/>\n\t\t\t\t\t<input name=\"reason_for_access\" id=\"reason_for_access_fodmap\" type=\"radio\" value=\"FODMAP\" \/><br \/>\n\t\t\t\t\tFODMAP<\/label>\n\t\t\t<\/div>\n<div>\n\t\t\t\t<label for=\"reason_for_access_wheat_allergy\"><br \/>\n\t\t\t\t\t<input name=\"reason_for_access\" id=\"reason_for_access_wheat_allergy\" type=\"radio\" value=\"Wheat Allergy\" \/><br \/>\n\t\t\t\t\tWheat Allergy<\/label>\n\t\t\t<\/div>\n<div>\n\t\t\t\t<label for=\"reason_for_access_peanut_or_tree_allergy\"><br \/>\n\t\t\t\t\t<input name=\"reason_for_access\" id=\"reason_for_access_peanut_or_tree_allergy\" type=\"radio\" value=\"Peanut or Tree Nut Allergy\" \/><br \/>\n\t\t\t\t\tPeanut or Tree Nut Allergy<\/label>\n\t\t\t<\/div>\n<div>\n\t\t\t\t<label for=\"reason_for_access_other\"><br \/>\n\t\t\t\t\t<input name=\"reason_for_access\" id=\"reason_for_access_other\" type=\"radio\" value=\"Other\" \/><br \/>\n\t\t\t\t\tOther<\/label><br \/>\n\t\t\t\t<label for=\"reason_for_access_other_description\">(please describe):<\/label><br \/>\n\t\t\t\t<input name=\"reason_for_access_other_description\" id=\"reason_for_access_other_description\" type=\"text\" \/>\n\t\t\t<\/div>\n<div id=\"elmreason_for_accessError\" class=\"errorMsg\">&nbsp;<\/div>\n<\/fieldset>\n<div>\n\t\t\t<input type=\"submit\" id=\"__btnSubmit\" name=\"__btnSubmit\" value=\"Submit\" \/><br \/>\n\t\t\t<input type=\"reset\" id=\"__btnReset\" name=\"__btnReset\" value=\"Reset\" \/>\n\t\t<\/div>\n<\/fieldset>\n<\/form>\n","protected":false},"excerpt":{"rendered":"<p>You don&#8217;t have JavaScript enabled. Please enable JavaScript in your browser settings and try link again. BU Student Gluten &amp; Nut Free Pantry Request Form First Name: * &nbsp; Last Name: * &nbsp; BUID: * U &nbsp; Email: * &nbsp; Reason for Access Request: * Celiac Disease Gluten Intolerance FODMAP Wheat Allergy Peanut or Tree [&hellip;]<\/p>\n","protected":false},"author":1251,"featured_media":0,"parent":61,"menu_order":9,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/scnc\/wp-json\/wp\/v2\/pages\/2323"}],"collection":[{"href":"https:\/\/www.bu.edu\/scnc\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/scnc\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/scnc\/wp-json\/wp\/v2\/users\/1251"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/scnc\/wp-json\/wp\/v2\/comments?post=2323"}],"version-history":[{"count":31,"href":"https:\/\/www.bu.edu\/scnc\/wp-json\/wp\/v2\/pages\/2323\/revisions"}],"predecessor-version":[{"id":5632,"href":"https:\/\/www.bu.edu\/scnc\/wp-json\/wp\/v2\/pages\/2323\/revisions\/5632"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/scnc\/wp-json\/wp\/v2\/pages\/61"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/scnc\/wp-json\/wp\/v2\/media?parent=2323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}