File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 22 {{ #if id }} id =" {{ id }} " {{ /if }}
33 class =" my-3 {{ class }} "
44 method =" {{ default method " post" }} "
5- {{ #if enctype }} enctype =" {{ enctype }} " {{ /if }}
5+ enctype =" {{ default enctype " multipart/form-data" }} "
6+ <!-- For efficiency, change the form encoding type on the default submit button if there is no file input -->
7+ {{ default_submit_formenctype = default enctype " application/x-www-form-urlencoded" }}
68 {{ #if action }} action =" {{ action }} "
79 {{ else }}
810 {{ #if id }} action =" #{{ id }} " {{ /if }}
120122 {{ /if }}
121123 {{ /if }}
122124 {{ #if eq type " file" }}
123- <!-- Change the form encoding type if this is a file input -->
124- {{ #delay }} formenctype= "multipart/form-data"{{ /delay }}
125+ <!-- Change the form encoding type on the default submit button if there is a file input and user has not set form enctype -->
126+ {{ default_submit_formenctype = default enctype " multipart/form-data" }}
125127 {{ /if }}
126128 {{ /each_row }}
127129 </div >
131133 {{ #if validate_shape }} btn-{{ validate_shape }} {{ /if }}
132134 {{ #if validate_outline }} btn-outline-{{ validate_outline }} {{ /if }}
133135 {{ #if validate_size }} btn-{{ validate_size }} {{ /if }} "
134- {{ flush_delayed }}
136+ {{ #if and (has_file not (enctyp }}
137+ formenctype ={{ default_submit_formenctype }}
138+ {{ /fi }}
135139 type =" submit"
136140 {{ #if validate }} value =" {{ validate }} " {{ /if }} >
137141 {{ /if }}
You can’t perform that action at this time.
0 commit comments