# NGBVD Data Entry JavaScript and Save Fix

This patch is intentionally functional only. It does not change the accepted UI/UX layout, colours, forms, cards, spacing or navigation.

## Fixed

1. Reference Number now synchronises into Survivor Code.
   - Works on typing, paste, change and before submit.
   - Applies to create and edit forms.

2. Nationality Status now cascades to Nationality Status Category.
   - Uses `/findNSCategory`.
   - Supports normal arrays and wrapped JSON payloads.
   - Works with Selectize where available.
   - Does not block saving if no categories exist for the selected status.

3. Save / draft-save reliability.
   - Before submit, Survivor Code is synchronised server-bound.
   - Empty unresolved cascading category fields no longer block submission.
   - Draft/save action value is set safely where action buttons are present.

## Files changed

- resources/views/dataentry/index.blade.php
- resources/views/dataentry/update.blade.php
- resources/views/dataentry/index_survivor.blade.php
- resources/views/dataentry/update_survivor.blade.php
- public/assets/js/ngbvd-dataentry-form-fixes.js
