hi, totally blind. using jaws for windows 2026, windows 11 pro, google chrome. now doing the build a to do app, and now stuck on step 66. have code it correctly and then it then deletes the special characters when the characters for the task data is then removed. have done resets, and then hard refresh, then did sign out and sign into free code camp, and did rewrite the function a couple of times. so is it my code, extra spacing, hidden characters. have tried to get this last step to pass for the past two or three hours. so wondering if it is a bug in fcc or got stuck or old caching. and need an immediate reply, and dont want to have to wait another 24 hours, so close to finishing this project. so if any one is online from my part of the globe, adelaide, australia, any one in australia, new zealand, asia, south pacific and in my time zone to help me out. will paste the code, the error message and the link to the step below. just want to get this finished, has been a very challenging project and taken me about 3 or 4 weeks to get to this point and using a screen reader and replying on speech, and not able to see, so, have been patient, dilligent, have researched on google. etc. so can any one help me now. sorry, have tried to be patient, but my patience is starting to wear thing, would like to get this project completed today. and i know i am the only blind person, so, i am sorry.
thank you.
marvin.
ps: pasting my script, error message and link below.
javascript:// DOM element references
const taskForm = document.getElementById("task-form");
const confirmCloseDialog = document.getElementById("confirm-close-dialog");
const openTaskFormBtn = document.getElementById("open-task-form-btn");
const closeTaskFormBtn = document.getElementById("close-task-form-btn");
const addOrUpdateTaskBtn = document.getElementById("add-or-update-task-btn");
const cancelBtn = document.getElementById("cancel-btn");
const discardBtn = document.getElementById("discard-btn");
const tasksContainer = document.getElementById("tasks-container");
const titleInput = document.getElementById("title-input");
const dateInput = document.getElementById("date-input");
const descriptionInput = document.getElementById("description-input");
// Helper function to remove special characters for IDs
const removeSpecialChars = (val) => {
return val.trim().replace(/[^A-Za-z0-9\s]/g, '');
};
// Task data from localStorage or empty array
const taskData = JSON.parse(localStorage.getItem("data")) || [];
let currentTask = {};
const addOrUpdateTask = () => {
if (!titleInput.value.trim()) {
alert("Please provide a title");
return;
}
const dataArrIndex = taskData.findIndex((item) => item.id === currentTask.id);
// FCC expects removeSpecialChars() to be called directly on titleInput.value
const cleanTitle = removeSpecialChars(titleInput.value);
const taskObj = {
id: `${cleanTitle.split(" ").join("-").toLowerCase()}-${Date.now()}`,
title: titleInput.value,
date: dateInput.value,
description: descriptionInput.value
};
if (dataArrIndex === -1) {
taskData.unshift(taskObj);
} else {
taskData[dataArrIndex] = taskObj;
}
localStorage.setItem("data", JSON.stringify(taskData));
updateTaskContainer();
reset();
};
// Update the UI with tasks
const updateTaskContainer = () => {
tasksContainer.innerHTML = "";
taskData.forEach(({ id, title, date, description }) => {
tasksContainer.innerHTML += `
<div class="task" id="${id}">
<p><strong>Title:</strong> ${title}</p>
<p><strong>Date:</strong> ${date}</p>
<p><strong>Description:</strong> ${description}</p>
<button onclick="editTask(this)" type="button" class="btn">Edit</button>
<button onclick="deleteTask(this)" type="button" class="btn">Delete</button>
</div>
`;
});
};
// Delete a task
const deleteTask = (buttonEl) => {
const dataArrIndex = taskData.findIndex((item) => item.id === buttonEl.parentElement.id);
buttonEl.parentElement.remove();
taskData.splice(dataArrIndex, 1);
localStorage.setItem("data", JSON.stringify(taskData));
};
// Edit a task
const editTask = (buttonEl) => {
const dataArrIndex = taskData.findIndex((item) => item.id === buttonEl.parentElement.id);
currentTask = taskData[dataArrIndex];
titleInput.value = currentTask.title;
dateInput.value = currentTask.date;
descriptionInput.value = currentTask.description;
addOrUpdateTaskBtn.innerText = "Update Task";
taskForm.classList.remove("hidden");
};
// Reset the form
const reset = () => {
addOrUpdateTaskBtn.innerText = "Add Task";
titleInput.value = "";
dateInput.value = "";
descriptionInput.value = "";
taskForm.classList.add("hidden");
currentTask = {};
};
// Load tasks if any exist
if (taskData.length) {
updateTaskContainer();
}
// Event listeners
openTaskFormBtn.addEventListener("click", () => taskForm.classList.toggle("hidden"));
closeTaskFormBtn.addEventListener("click", () => {
const formHasValues = titleInput.value || dateInput.value || descriptionInput.value;
const formChanged =
titleInput.value !== currentTask.title ||
dateInput.value !== currentTask.date ||
descriptionInput.value !== currentTask.description;
if (formHasValues && formChanged) {
confirmCloseDialog.showModal();
} else {
reset();
}
});
cancelBtn.addEventListener("click", () => confirmCloseDialog.close());
discardBtn.addEventListener("click", () => {
confirmCloseDialog.close();
reset();
});
taskForm.addEventListener("submit", (e) => {
e.preventDefault();
addOrUpdateTask();
});
errors:
Sorry, your code does not pass. You’re getting there.
You should call removeSpecialChars on titleInput.value when assigning the id.
link to the step: