Closed (fixed)
Project:
Webform
Version:
8.x-5.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2018 at 20:58 UTC
Updated:
9 Nov 2018 at 16:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jrockowitz commentedThe #name attribute is not recommended and not available via the UI.
I think the source mode should enforce all element key's to be lower-cased with underscores.
Comment #3
nsciaccaI see... I agree that if uppercase is not supported then it should be validated and not allowed in the Source mode. As it is now, if you edit the Source and introduce uppercase, it appears to save and work, but using the UI for that element it throws an error saying the key needs to be lowercase.
As for the #name attribute - although it doesn't have a specific field for a "name" in the UI, you can set it either in the custom properties or on the element attributes. Again, if it's not supported, it shouldn't save/render in the markup the way it is - just leads it to be broken and confusing to the end user.
My specific project requirements is to post my form to a third-party that is expecting specific "name" values. So I'm going to attempt to do all my validation on the client side since posting to Webform's submission table is not required. Still, it would be nice if it custom name values were supported and didn't break the validation.
Comment #4
jrockowitz commentedThe attached patch validates element key entered via 'Edit Source'.
@nsciacca The #name attribute is "kind of supported" but breaks webform integration and validation.
To integrate with a third party, I recommend using the Remote Post handler
Comment #6
jrockowitz commentedI committed the patch. Please download the latest dev release to review.