Describe the problem
It's a bug that you can manually specify the name of a remote form input:
<form {...myform}>
<!-- good -->
<input {...myform.fields.message.as('text')} />
<!-- bad -->
<input name="message" />
<button>submit</button>
</form>
It's bad because it defeats type safety, and because it allows you to accidentally use a field from the wrong form, and because people will come to do weird shit that will break if we're forced to change some detail of the implementation at a later date.
Describe the proposed solution
Enforce the correct use of remote form fields by prefixing the name with an identifier, so that this...
<input {...myform.fields.message.as('text')} />
...renders as something like this:
<input type="text" name="xyz123/myform/s/message" value="..." aria-invalid="..." />
(I don't think we should include the id of a .for(...) in the prefix, that would be annoying.)
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
Describe the problem
It's a bug that you can manually specify the
nameof a remote form input:It's bad because it defeats type safety, and because it allows you to accidentally use a field from the wrong form, and because people will come to do weird shit that will break if we're forced to change some detail of the implementation at a later date.
Describe the proposed solution
Enforce the correct use of remote form fields by prefixing the
namewith an identifier, so that this......renders as something like this:
(I don't think we should include the
idof a.for(...)in the prefix, that would be annoying.)Alternatives considered
No response
Importance
nice to have
Additional Information
No response