Change one form’s button
This delivery form inherits the page’s defaults but
overrides
next-label. Its button keeps this wording when
the shared labels change.
Code
<form-fieldset-progress review-panel
next-label="Next delivery step">
<form>
<fieldset><legend>Delivery address</legend>
<label>City <input name="city" /></label>
</fieldset>
<fieldset><legend>Delivery notes</legend>
<label>Notes <textarea name="notes"></textarea></label>
</fieldset>
<button type="submit">Save delivery details</button>
</form>
</form-fieldset-progress>
Live example
Update wording without starting over
While either form is on review, choose Use shorter wording. The generated title and empty-answer message change in place. The active section and captured answers stay put; Back still lets you edit them. This demo intercepts submissions without sending data when JavaScript is available.
Editing JSON alone doesn’t update existing forms. Call
refreshLabels() on each ready instance. If
configuration is invalid, it returns false and
emits an error without changing the working UI. Correct the
JSON and call it again. See the
shared-label reference
for validation and recovery details.
Code
const script = document.querySelector(
'[data-form-fieldset-progress-config]',
);
const labels = JSON.parse(script.textContent);
labels['review-label'] = 'Your answers';
labels['review-empty-label'] = 'No answer';
script.textContent = JSON.stringify(labels);
const updated = Array.from(
document.querySelectorAll('form-fieldset-progress'),
(element) => element.refreshLabels(),
).every(Boolean);