UK-SBCoA / uniform-data-set-dotnet-web

.NET Core implementation of UDS with MVC and Razor Class UI Library
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Saving values for checkboxes when enabled/disabled by radio buttons #166

Open smiththay opened 1 month ago

smiththay commented 1 month ago

Checkboxes that are enabled/disabled by a radio button do not save initially if validation on the form kicks on but will save if reentered.

A few forms effected by this are the A5-D2, B9, D1a.

To replicate: 1.) Go to any form mentioned above or where a radio button is enabled/disabled by a radio button 2.) Must be a new visit and form cannot be in progress or previously saved. 3.) Fill out form and enable checkbox and check it 4.) Any part of the form that is required needs to be left blank so validation will kick on. 5.) Save/Complete the form 6.) validation will kick on from Q from step 4. 7.) Go to checkbox that was checked, value should be missing.

This issue does not persist if there is no enabling/disabling of the checkbox in the code behind.

mlan225 commented 1 day ago

A5D2 checkbox when submitting a completed form

After refilling out the checkbox and submitting the same form, it will be successfully submitted.

A5D2 checkbox when submitting a form with an error

Looks like the checkbox values are not being sent on the first submission. Looking into a reasoning and resolution