Core Calculation & Display
updateTally()
→ Calculates totals (recurring & one-off) with exchange rates, frequency multipliers, and taxes, then updates the tally UI.
updateProgressBar()
→ Updates the progress bar width based on the current step.
showCompletionMessage()
→ Displays the "Questions Complete" message, hides the form, and saves state.
Answers & Comments Synchronization
updateTextareaAndTags()
→ Updates the comment textarea and clickable tag bubbles from selected answers.
syncCommentsToAnswers()
→ Parses textarea comments back into the answers array and updates UI accordingly.
onTextareaInput()
→ Input handler for textareas; keeps answers, tags, tally, and state in sync.
Step Navigation
updateNavButtons()
→ Enables/disables Next/Previous buttons based on progress and input.
showStep(index)
→ Displays the given form step, highlights selected answers, attaches listeners, restores custom buttons, and syncs UI.
State Management
saveWizardState()
→ Saves current answers, comments, and step index to localStorage.
loadWizardState()
→ Restores state from localStorage, including currency, frequency, and tally.
getAppState()
→ Reads app state safely from localStorage.
setAppState(state)
→ Writes app state safely to localStorage.
Event Bindings
Button click handlers:
→ For normal answers, multi-select logic, or custom "Other" input replacement.
Next button click → moves forward (or finishes).
Prev button click → moves backward.
Textarea handlers → sync with answers and trigger navigation on Enter.
Copyright © - TA BY:SKIZCorp | ... | NR