Template source: hr_assessment.html

{% extends "_layouts/base.html" %} {% block css %} <style> .assessment-shell { --primary: #006991; --accent: #00acdb; --blue: #00acdc; --navy: #16324f; --gray: #5f6b76; --light: #f4f8fa; --border: #d6e1e7; --danger: #b42318; --white: #ffffff; --green: #2f6b16; width: min(960px, calc(100% - 32px)); margin: 32px auto; background: var(--white); border-radius: 14px; box-shadow: 0 8px 28px rgba(18, 50, 79, 0.1); overflow: hidden; font-family: Arial, Helvetica, sans-serif; font-size: 16px; color: var(--navy); line-height: 1.5; } .assessment-shell, .assessment-shell * { box-sizing: border-box; } .assessment-shell .assessment-header { height: auto; width: auto; padding: 34px 36px 26px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: var(--white); } .assessment-shell .assessment-header h1 { margin: 0 0 8px; font-size: clamp(1.8em, 4vw, 2.6em); line-height: 1.15; color: var(--white); text-transform: none; position: static; } .assessment-shell .assessment-header p { margin: 0; max-width: 760px; font-size: 1.05em; color: var(--white); } .assessment-shell form { padding: 30px 36px 40px; } .assessment-shell fieldset { margin: 0 0 26px; padding: 0; border: 0; } .assessment-shell legend { display: block; width: 100%; margin: 0 0 12px; padding: 0; font-size: 1.06em; font-weight: 700; line-height: 1.4; color: var(--navy); border: 0; } .assessment-shell .section-heading { margin: 34px 0 8px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); font-size: 1.35em; color: var(--navy); } .assessment-shell .section-intro { margin: 0 0 24px; color: var(--gray); font-size: 1em; } .assessment-shell .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; } .assessment-shell .form-group label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 1em; } .assessment-shell input[type="text"], .assessment-shell input[type="email"], .assessment-shell select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); color: var(--navy); font-size: 1em; } .assessment-shell input:focus, .assessment-shell select:focus { outline: 3px solid rgba(0, 172, 219, 0.18); border-color: var(--accent); } .assessment-shell .choice-list { display: grid; gap: 10px; } .assessment-shell .choice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); cursor: pointer; font-size: 1em; font-weight: 400; } .assessment-shell .choice:hover { border-color: var(--accent); } .assessment-shell .choice input { margin-top: 3px; flex: 0 0 auto; } .assessment-shell .help-text { display: block; margin-top: 7px; color: var(--gray); font-size: 0.9em; } .assessment-shell .required { color: var(--danger); } .assessment-shell .error-message { display: none; margin: 0 0 18px; padding: 12px 14px; border-left: 4px solid var(--danger); background: #fff2f0; color: var(--danger); border-radius: 6px; } .assessment-shell .submit-button { width: 100%; min-height: 52px; border: 0; border-radius: 8px; background: var(--blue); color: #ffffff; font-size: 1.08em; font-weight: 800; cursor: pointer; } .assessment-shell .submit-button:hover { filter: brightness(0.96); } .assessment-shell .consent { margin: 14px 0 0; color: var(--gray); font-size: 0.85em; text-align: center; } .assessment-shell .consent a { color: var(--primary); } .assessment-shell #results { display: none; margin-top: 30px; padding: 24px; border: 2px solid var(--accent); border-radius: 12px; background: #f7fcfe; } .assessment-shell #results h2 { margin-top: 0; font-size: 1.5em; } .assessment-shell .result-card { margin: 14px 0; padding: 18px; border-radius: 10px; background: var(--white); border: 1px solid var(--border); } .assessment-shell .result-card.primary { border: 2px solid var(--green); } .assessment-shell .result-label { margin: 0 0 4px; color: var(--primary); font-size: 0.82em; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; } .assessment-shell .result-card h3 { margin: 0 0 8px; font-size: 1.35em; } .assessment-shell .score-bar { height: 10px; margin-top: 12px; overflow: hidden; background: #e7eef2; border-radius: 999px; } .assessment-shell .score-bar span { display: block; height: 100%; background: var(--accent); } .assessment-shell .eligibility-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; padding: 0; list-style: none; } .assessment-shell .eligible { color: #2f6b16; } .assessment-shell .not-eligible { color: var(--gray); } .assessment-shell .disclaimer { margin-top: 18px; color: var(--gray); font-size: 0.86em; } @media (max-width: 720px) { .assessment-shell .grid-3, .assessment-shell .eligibility-list { grid-template-columns: 1fr; } .assessment-shell .assessment-header, .assessment-shell form { padding-left: 22px; padding-right: 22px; } } </style> {% endblock %} {% block content %} <main class="assessment-shell"> <div class="assessment-header"> <h1>Which HR Certification Is Right for You?</h1> <p> This short assessment will help identify the HR certifications you may qualify for and recommend the best fit based on your experience, career goals, and exam preferences. Be sure to verify the official eligibility requirements before applying for your chosen certification exam. </p> </div> <form id="certAssessment" novalidate> <h2 class="section-heading">Your Information</h2> <div class="grid-3"> <div class="form-group"> <label for="firstName"> First name <span class="required">*</span> </label> <input id="firstName" name="firstName" type="text" autocomplete="given-name" required /> </div> <div class="form-group"> <label for="lastName"> Last name <span class="required">*</span> </label> <input id="lastName" name="lastName" type="text" autocomplete="family-name" required /> </div> <div class="form-group"> <label for="email"> Email address <span class="required">*</span> </label> <input id="email" name="email" type="email" autocomplete="email" required /> </div> </div> <h2 class="section-heading">Part 1: Eligibility</h2> <p class="section-intro"> The first four questions help determine which certifications you may be eligible for. We only recommend certifications based on the information you provide; however, HRCI and SHRM make the final determination of exam eligibility. </p> <fieldset> <legend> 1. What is your highest level of education? <span class="required">*</span> </legend> <div class="choice-list"> <label class="choice"> <input type="radio" name="education" value="less_bachelors" required /> High school diploma, GED/equivalent, or associate degree </label> <label class="choice"> <input type="radio" name="education" value="bachelors" /> Bachelor's degree </label> <label class="choice"> <input type="radio" name="education" value="masters" /> Master's degree or higher </label> </div> <span class="help-text"> For HRCI eligibility, the degree does not need to be in HR. </span> </fieldset> <fieldset> <legend> 2. How many completed years of professional-level HR experience do you have? <span class="required">*</span> </legend> <select id="professionalYears" name="professionalYears" required > <option value="">Select completed years</option> <option value="0">Less than 1 year</option> <option value="1">1 year</option> <option value="2">2 years</option> <option value="3">3 years</option> <option value="4">4 years</option> <option value="5">5 years</option> <option value="6">6 years</option> <option value="7">7 years</option> <option value="8">8 or more years</option> </select> <span class="help-text"> Professional-level HR work generally includes independent judgment, specialized HR knowledge, decision-making authority, analysis, and accountability for results. Entry-level clerical or assistant duties may not qualify. </span> </fieldset> <fieldset> <legend> 3. How many completed years have you performed strategic-level HR duties? <span class="required">*</span> </legend> <select id="strategicYears" name="strategicYears" required > <option value="">Select completed years</option> <option value="0">Less than 1 year</option> <option value="1">1 year</option> <option value="2">2 years</option> <option value="3">3 years</option> <option value="4">4 years</option> <option value="5">5 or more years</option> </select> <span class="help-text"> Strategic-level duties may include developing HR strategy, leading enterprise-wide initiatives, aligning people practices with business goals, influencing senior leaders, or shaping policy. </span> </fieldset> <fieldset> <legend> 4. Have you held the SHRM-CP credential for at least three years and are you working in, or transitioning to, a strategic-level role? <span class="required">*</span> </legend> <div class="choice-list"> <label class="choice"> <input type="radio" name="shrmPath" value="yes" required /> Yes </label> <label class="choice"> <input type="radio" name="shrmPath" value="no" /> No </label> </div> </fieldset> <h2 class="section-heading">Part 2: Career Fit and Preference</h2> <p class="section-intro"> The remaining questions help identify the certification that best fits your career goals, professional interests, and exam preferences, allowing us to provide a more personalized recommendation. </p> <fieldset> <legend> 5. Which best describes your current or most recent HR responsibilities? <span class="required">*</span> </legend> <div class="choice-list"> <label class="choice"> <input type="radio" name="roleLevel" value="entry" required /> I am entering HR or providing entry-level HR support </label> <label class="choice"> <input type="radio" name="roleLevel" value="operational" /> I independently handle day-to-day HR operations </label> <label class="choice"> <input type="radio" name="roleLevel" value="advanced" /> I oversee HR programs and solve complex HR issues </label> <label class="choice"> <input type="radio" name="roleLevel" value="strategic" /> I develop HR strategy and influence organizational decisions </label> </div> </fieldset> <fieldset> <legend> 6. What are your primary career goals right now? Select up to two. <span class="required">*</span> </legend> <div class="choice-list" id="goalChoices"> <label class="choice"> <input type="checkbox" name="goals" value="enter" /> Enter the HR field and build foundational knowledge </label> <label class="choice"> <input type="checkbox" name="goals" value="operational" /> Advance in day-to-day or operational HR roles </label> <label class="choice"> <input type="checkbox" name="goals" value="leadership" /> Move into senior HR leadership or strategic roles </label> <label class="choice"> <input type="checkbox" name="goals" value="influence" /> Expand my strategic business influence </label> <label class="choice"> <input type="checkbox" name="goals" value="credential" /> Earn a respected HR credential </label> <label class="choice"> <input type="checkbox" name="goals" value="specialize" /> Build specialized HR expertise </label> </div> <span class="help-text"> Choose one or two. </span> </fieldset> <fieldset> <legend> 7. Which exam style sounds most appealing? <span class="required">*</span> </legend> <div class="choice-list"> <label class="choice"> <input type="radio" name="examStyle" value="technical" required /> An exam emphasizing HR laws, regulations, and technical knowledge </label> <label class="choice"> <input type="radio" name="examStyle" value="situational" /> An exam emphasizing behavioral competencies and workplace situations </label> <label class="choice"> <input type="radio" name="examStyle" value="balanced" /> A balanced mix of technical knowledge and situational judgment </label> </div> </fieldset> <fieldset> <legend> 8. An employee reports being treated unfairly by a supervisor. What would you most likely do first? <span class="required">*</span> </legend> <div class="choice-list"> <label class="choice"> <input type="radio" name="judgment" value="learn" required /> Refer to policy or ask a more experienced HR professional for guidance </label> <label class="choice"> <input type="radio" name="judgment" value="investigate" /> Gather facts, document the issue, and follow established procedures </label> <label class="choice"> <input type="radio" name="judgment" value="patterns" /> Assess whether broader organizational patterns contributed to the issue </label> <label class="choice"> <input type="radio" name="judgment" value="strategy" /> Evaluate enterprise risk and recommend strategic or policy changes </label> </div> </fieldset> <fieldset> <legend> 9. How would you rate your knowledge and application of U.S. employment laws? <span class="required">*</span> </legend> <div class="choice-list"> <label class="choice"> <input type="radio" name="lawKnowledge" value="beginner" required /> Beginner: little or no knowledge </label> <label class="choice"> <input type="radio" name="lawKnowledge" value="working" /> Working knowledge: understand and sometimes apply major laws </label> <label class="choice"> <input type="radio" name="lawKnowledge" value="advanced" /> Advanced: regularly apply laws to HR decisions </label> <label class="choice"> <input type="radio" name="lawKnowledge" value="expert" /> Extensive: advise others and manage complex compliance issues </label> </div> </fieldset> <fieldset> <legend> 10. How often do you use HR data or business information to influence decisions? <span class="required">*</span> </legend> <div class="choice-list"> <label class="choice"> <input type="radio" name="analytics" value="rarely" required /> Rarely or never </label> <label class="choice"> <input type="radio" name="analytics" value="occasionally" /> Occasionally </label> <label class="choice"> <input type="radio" name="analytics" value="frequently" /> Frequently </label> <label class="choice"> <input type="radio" name="analytics" value="enterprise" /> Regularly influence organization-wide decisions </label> </div> </fieldset> <div id="formError" class="error-message" role="alert" ></div> <button class="submit-button" type="submit" > Get My Recommendation </button> <p class="consent"> By submitting this form, you consent to receive marketing and promotional communications from HRCP via email. You may opt out of these communications at any time by clicking the unsubscribe link included in our emails or by contacting us directly. For more information about how we handle your personal data, please review our <a href="https://hrcp.com/privacy_and_security/" target="_blank" rel="noopener" > Privacy Policy </a>. </p> <section id="results" aria-live="polite" ></section> </form> </main> <script> (() => { const form = document.getElementById("certAssessment"); const results = document.getElementById("results"); const errorBox = document.getElementById("formError"); const goalInputs = [ ...document.querySelectorAll('input[name="goals"]') ]; const certDescriptions = { "aPHR": "A foundational HRCI credential for people beginning an HR career or building core HR knowledge.", "PHR": "An HRCI credential focused on technical and operational HR knowledge, including U.S. laws and regulations.", "SPHR": "An HRCI credential designed for experienced HR leaders who shape strategy, policy, and organizational direction.", "SHRM-CP": "A competency-based credential for people performing operational HR duties or pursuing an HR career.", "SHRM-SCP": "A competency-based credential for senior professionals with strategic-level HR responsibilities." }; goalInputs.forEach((input) => { input.addEventListener("change", () => { const selected = goalInputs.filter((item) => item.checked); if (selected.length > 2) { input.checked = false; showError( "Please select no more than two career goals." ); } else { clearError(); } }); }); form.addEventListener("submit", (event) => { event.preventDefault(); clearError(); if (!form.checkValidity()) { form.reportValidity(); showError( "Please complete all required fields." ); return; } const selectedGoals = goalInputs .filter((item) => item.checked) .map((item) => item.value); if ( selectedGoals.length === 0 || selectedGoals.length > 2 ) { showError( "Please select one or two career goals." ); return; } const data = new FormData(form); const answers = { firstName: String( data.get("firstName") || "" ).trim(), lastName: String( data.get("lastName") || "" ).trim(), email: String( data.get("email") || "" ).trim(), education: data.get("education"), professionalYears: Number( data.get("professionalYears") ), strategicYears: Number( data.get("strategicYears") ), shrmPath: data.get("shrmPath"), roleLevel: data.get("roleLevel"), goals: selectedGoals, examStyle: data.get("examStyle"), judgment: data.get("judgment"), lawKnowledge: data.get("lawKnowledge"), analytics: data.get("analytics") }; const eligibility = determineEligibility(answers); const scores = calculateScores(answers); const rankedEligible = Object .keys(scores) .filter( (cert) => eligibility[cert].eligible ) .sort( (a, b) => scores[b] - scores[a] ); renderResults( answers, eligibility, scores, rankedEligible ); fetch("/cert_fit_assessment/submit/", { method: "POST", headers: { "Accept": "application/json", "Content-Type": "application/json" }, body: JSON.stringify({ name: answers.firstName + " " + answers.lastName, email: answers.email, recommendation: JSON.stringify({ primary: rankedEligible[0] || null, alternative: rankedEligible[1] || null }) }) }).catch(() => { /* results already shown; saving is best-effort */ }); }); function determineEligibility(answers) { const degree = answers.education; const years = answers.professionalYears; const phrEligible = ( degree === "masters" && years >= 1 ) || ( degree === "bachelors" && years >= 2 ) || ( degree === "less_bachelors" && years >= 4 ); const sphrEligible = ( degree === "masters" && years >= 4 ) || ( degree === "bachelors" && years >= 5 ) || ( degree === "less_bachelors" && years >= 7 ); const shrmScpEligible = answers.strategicYears >= 3 || answers.shrmPath === "yes"; return { "aPHR": { eligible: true, reason: "No prior HR experience is required." }, "PHR": { eligible: phrEligible, reason: phrEligible ? "Your education and professional-level HR experience meet the stated HRCI threshold." : getPhrGap(degree, years) }, "SPHR": { eligible: sphrEligible, reason: sphrEligible ? "Your education and professional-level HR experience meet the stated HRCI threshold." : getSphrGap(degree, years) }, "SHRM-CP": { eligible: true, reason: "No degree or specific prior HR experience is required." }, "SHRM-SCP": { eligible: shrmScpEligible, reason: shrmScpEligible ? "You reported at least three years of strategic-level HR duties or the qualifying SHRM-CP pathway." : "SHRM-SCP generally requires at least three years of strategic-level HR duties, or the qualifying SHRM-CP pathway." } }; } function getPhrGap(degree, years) { const required = degree === "masters" ? 1 : degree === "bachelors" ? 2 : 4; const remaining = Math.max(0, required - years); return ( "Not currently eligible based on the information provided. " + "You need approximately " + remaining + " more completed year" + (remaining === 1 ? "" : "s") + " of professional-level HR experience for this education level." ); } function getSphrGap(degree, years) { const required = degree === "masters" ? 4 : degree === "bachelors" ? 5 : 7; const remaining = Math.max(0, required - years); return ( "Not currently eligible based on the information provided. " + "You need approximately " + remaining + " more completed year" + (remaining === 1 ? "" : "s") + " of professional-level HR experience for this education level." ); } function calculateScores(answers) { const scores = { "aPHR": 0, "PHR": 0, "SPHR": 0, "SHRM-CP": 0, "SHRM-SCP": 0 }; const roleScores = { entry: { "aPHR": 35, "PHR": 5, "SPHR": 0, "SHRM-CP": 25, "SHRM-SCP": 0 }, operational: { "aPHR": 8, "PHR": 35, "SPHR": 5, "SHRM-CP": 32, "SHRM-SCP": 5 }, advanced: { "aPHR": 0, "PHR": 28, "SPHR": 22, "SHRM-CP": 24, "SHRM-SCP": 22 }, strategic: { "aPHR": 0, "PHR": 8, "SPHR": 38, "SHRM-CP": 12, "SHRM-SCP": 38 } }; applyMap( scores, roleScores[answers.roleLevel] ); const goalScores = { enter: { "aPHR": 25, "PHR": 0, "SPHR": 0, "SHRM-CP": 20, "SHRM-SCP": 0 }, operational: { "aPHR": 5, "PHR": 25, "SPHR": 0, "SHRM-CP": 22, "SHRM-SCP": 0 }, leadership: { "aPHR": 0, "PHR": 5, "SPHR": 24, "SHRM-CP": 5, "SHRM-SCP": 24 }, influence: { "aPHR": 0, "PHR": 4, "SPHR": 25, "SHRM-CP": 6, "SHRM-SCP": 25 }, credential: { "aPHR": 8, "PHR": 8, "SPHR": 8, "SHRM-CP": 8, "SHRM-SCP": 8 }, specialize: { "aPHR": 4, "PHR": 12, "SPHR": 10, "SHRM-CP": 12, "SHRM-SCP": 10 } }; answers.goals.forEach((goal) => { applyMap( scores, goalScores[goal] ); }); const examStyleScores = { technical: { "aPHR": 18, "PHR": 28, "SPHR": 20, "SHRM-CP": 5, "SHRM-SCP": 5 }, situational: { "aPHR": 5, "PHR": 7, "SPHR": 10, "SHRM-CP": 28, "SHRM-SCP": 28 }, balanced: { "aPHR": 14, "PHR": 16, "SPHR": 16, "SHRM-CP": 16, "SHRM-SCP": 16 } }; applyMap( scores, examStyleScores[answers.examStyle] ); const judgmentScores = { learn: { "aPHR": 20, "PHR": 4, "SPHR": 0, "SHRM-CP": 12, "SHRM-SCP": 0 }, investigate: { "aPHR": 6, "PHR": 22, "SPHR": 8, "SHRM-CP": 20, "SHRM-SCP": 8 }, patterns: { "aPHR": 0, "PHR": 14, "SPHR": 20, "SHRM-CP": 16, "SHRM-SCP": 20 }, strategy: { "aPHR": 0, "PHR": 5, "SPHR": 25, "SHRM-CP": 8, "SHRM-SCP": 25 } }; applyMap( scores, judgmentScores[answers.judgment] ); const lawScores = { beginner: { "aPHR": 20, "PHR": 3, "SPHR": 0, "SHRM-CP": 8, "SHRM-SCP": 2 }, working: { "aPHR": 8, "PHR": 18, "SPHR": 6, "SHRM-CP": 12, "SHRM-SCP": 6 }, advanced: { "aPHR": 0, "PHR": 22, "SPHR": 13, "SHRM-CP": 12, "SHRM-SCP": 11 }, expert: { "aPHR": 0, "PHR": 12, "SPHR": 20, "SHRM-CP": 8, "SHRM-SCP": 16 } }; applyMap( scores, lawScores[answers.lawKnowledge] ); const analyticsScores = { rarely: { "aPHR": 12, "PHR": 3, "SPHR": 0, "SHRM-CP": 5, "SHRM-SCP": 0 }, occasionally: { "aPHR": 5, "PHR": 12, "SPHR": 5, "SHRM-CP": 12, "SHRM-SCP": 5 }, frequently: { "aPHR": 0, "PHR": 14, "SPHR": 14, "SHRM-CP": 14, "SHRM-SCP": 14 }, enterprise: { "aPHR": 0, "PHR": 5, "SPHR": 20, "SHRM-CP": 8, "SHRM-SCP": 20 } }; applyMap( scores, analyticsScores[answers.analytics] ); return scores; } function applyMap(scoreObject, pointMap) { if (!pointMap) { return; } Object.entries(pointMap).forEach( ([cert, points]) => { scoreObject[cert] += points; } ); } function normalizeScores( scores, eligibleCerts ) { const values = eligibleCerts.map( (cert) => scores[cert] ); const max = Math.max(...values, 1); return Object.fromEntries( eligibleCerts.map((cert) => [ cert, Math.round( (scores[cert] / max) * 100 ) ]) ); } function renderResults( answers, eligibility, scores, rankedEligible ) { const normalized = normalizeScores( scores, rankedEligible ); const primary = rankedEligible[0]; const alternate = rankedEligible[1]; const future = Object .keys(eligibility) .filter( (cert) => !eligibility[cert].eligible ) .sort( (a, b) => scores[b] - scores[a] )[0]; const eligibilityHtml = Object .entries(eligibility) .map(([cert, status]) => { return ` <li class="${ status.eligible ? "eligible" : "not-eligible" }"> <strong> ${ status.eligible ? "✓" : "○" } ${cert} </strong> — ${escapeHtml(status.reason)} </li> `; }) .join(""); const primaryHtml = ` <article class="result-card primary"> <p class="result-label"> Best Current Fit </p> <h3>${primary}</h3> <p> ${certDescriptions[primary]} </p> <p> <strong> Fit score among eligible options: ${normalized[primary]}% </strong> </p> <div class="score-bar" aria-hidden="true" > <span style="width: ${normalized[primary]}%" ></span> </div> </article> `; const alternateHtml = alternate ? ` <article class="result-card"> <p class="result-label"> Also Worth Considering </p> <h3>${alternate}</h3> <p> ${certDescriptions[alternate]} </p> <p> <strong> Relative fit score: ${normalized[alternate]}% </strong> </p> <div class="score-bar" aria-hidden="true" > <span style="width: ${normalized[alternate]}%" ></span> </div> </article> ` : ""; const futureHtml = future ? ` <article class="result-card"> <p class="result-label"> Future Credential Path </p> <h3>${future}</h3> <p> ${certDescriptions[future]} </p> <p> ${escapeHtml( eligibility[future].reason )} </p> </article> ` : ""; results.innerHTML = ` <h2> ${escapeHtml(answers.firstName)}, your recommendation is ready. </h2> ${primaryHtml} ${alternateHtml} ${futureHtml} <h3> Your eligibility summary </h3> <ul class="eligibility-list"> ${eligibilityHtml} </ul> <p class="disclaimer"> This assessment provides general guidance based on the answers submitted. Certification bodies make final eligibility determinations and may request documentation. Requirements can change, so candidates should verify current requirements directly with HRCI or SHRM before applying. </p> `; results.style.display = "block"; results.scrollIntoView({ behavior: "smooth", block: "start" }); } function showError(message) { errorBox.textContent = message; errorBox.style.display = "block"; } function clearError() { errorBox.textContent = ""; errorBox.style.display = "none"; } function escapeHtml(value) { return String(value) .replaceAll("&", "&amp;") .replaceAll("<", "&lt;") .replaceAll(">", "&gt;") .replaceAll('"', "&quot;") .replaceAll("'", "&#039;"); } })(); </script> {% endblock %}