Open
Conversation
(&, <, >, ") for default types (not date related, file, checkbox or range)
…n a rendered form if schema specifies default="true" even when source xml (from generated from XML, not just schema) specifies false
…cify default or fixed value. (Previously this was only the case if use="optional" was specified)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Furthering the fix to #23, an empty value is added to an HTML select element when there is no default or fixed value specified.
This doesn't alter the existing behaviour that attributes with
@use="optional"provides an default, empty valueIf there is no
@use,@defaultor@fixedattributes a default, empty value is provided (this is a change)If
@use="required"is specified a default, empty value is still provided, so that the user has to make an informed choice, rather than the first item in the list being pre-selected and possibly submitted without even thinking about it. If the user tries to submit the form without chosing a valid (non-empty) selection then the HTML validation will complain.If
@defaultor@fixedis provided, no empty value will be provided. I think this is definitely correct for@fixed, but@defaultcould be argued that we should allow an empty value, but it shouldn't be the default. I did test this, but it is not what I am submitting because in my case my XML processor (that handles the submitted form) adds omitted attributes with their default value anyway. I don't mind adding this (a blank option when@defaultis set) if you think it is incorrect though.