Skip to content

Commit 9b8d2f1

Browse files
Daniel SheffieldDaniel Sheffield
authored andcommitted
#458 - allow user to set formenctype
1 parent 33b3d85 commit 9b8d2f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sqlpage/templates/form.handlebars

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{{#if id}}id="{{id}}"{{/if}}
33
class="my-3 {{class}}"
44
method="{{default method "post"}}"
5+
{{#if formenctype}}formenctype="{{formenctype}}"{{/if}}
56
{{#if action}}action="{{action}}"
67
{{else}}
78
{{#if id}}action="#{{id}}"{{/if}}
@@ -118,7 +119,7 @@
118119
</label>
119120
{{/if}}
120121
{{/if}}
121-
{{#if (eq type "file")}}
122+
{{#if and (eq type "file") (not formenctype)}}
122123
<!-- Change the form encoding type if this is a file input-->
123124
{{#delay}}formenctype="multipart/form-data"{{/delay}}
124125
{{/if}}
@@ -131,6 +132,7 @@
131132
{{#if validate_outline}} btn-outline-{{validate_outline}} {{/if}}
132133
{{#if validate_size}} btn-{{validate_size}} {{/if}}"
133134
{{flush_delayed}}
135+
{{#if formenctype}}formenctype="{{formenctype}}"{{/if}}
134136
type="submit"
135137
{{#if validate}}value="{{validate}}"{{/if}}>
136138
{{/if}}

0 commit comments

Comments
 (0)