You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Add another documentation and example are designed so that JavaScript is required. It mentions this:
The add another component relies on JavaScript. When JavaScript is not available, your page should reload with the additional form elements if the "Add another" button is pressed.
In real services we require all functionality to work without JavaScript, so this is not sufficient and we should update the documentation to start from a server-side approach and add the JavaScript functionality as a progressive enhancement.
The main changes needed to the example itself are:
Add a remove button with class moj-add-another__remove-button (JS doesn't add a new one if it already exists)
Add suitable name attributes to buttons so that the server-side can hook in
We should then document the server-side logic required, and then introduce what adding the JS functionality does.
The Add another documentation and example are designed so that JavaScript is required. It mentions this:
In real services we require all functionality to work without JavaScript, so this is not sufficient and we should update the documentation to start from a server-side approach and add the JavaScript functionality as a progressive enhancement.
The main changes needed to the example itself are:
moj-add-another__remove-button
(JS doesn't add a new one if it already exists)name
attributes to buttons so that the server-side can hook inWe should then document the server-side logic required, and then introduce what adding the JS functionality does.
I've set up an example project in Glitch to demo working server-side functionality.
The text was updated successfully, but these errors were encountered: