Skip to content
Draft
10 changes: 10 additions & 0 deletions main_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,16 @@ def render_admin_dashboard_page():
"""
return render_template("admin_dashboard.html")

# Participant Handbook and Participant Agreement Assessment
@app.route("/participant-assessment")
def render_participant_assessment_page():
"""
Renders the participant assessment page from jinja2 template
"""
return render_template("participant_assessment.html")


# Eventbrite event displaying

def get_events():
try:
Expand Down
277 changes: 277 additions & 0 deletions static/css/participant_assessment.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions static/css/participant_assessment.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 33 additions & 1 deletion static/js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,36 @@ function validateForm() {
} else {
window.location.href = "/app-household";
}
}
}

// participant assessment form save button input validation
function saveBtnValidation(){
document.addEventListener("DOMContentLoaded", function () {

const form = document.getElementById("participant_assessment");

saveButton.addEventListener("click", () => {
const requiredInputs = form.querySelectorAll("input[required]");
let isValid = true;

requiredInputs.forEach((input) => {
const parentElement = input.parentNode;
parentElement.style.border = "";

if (
(input.type === "radio" || input.type === "checkbox") &&
!form.querySelector(`[name="${input.name}"]:checked`)
) {
isValid = false;
parentElement.style.border = "2px solid red";
}
});

if (!isValid) {
alert("Please fill out all required fields.");
} else {
window.location.href = "/thankyou";
}
});
});
}
Loading