Browse Source

add option 'require' for textarea form elements

pull/7692/head
Tobias Diekershoff 2 weeks ago
parent
commit
8db7934a30
2 changed files with 2 additions and 1 deletions
  1. 1
    0
      doc/smarty3-templates.md
  2. 1
    1
      view/templates/field_textarea.tpl

+ 1
- 0
doc/smarty3-templates.md View File

@@ -177,6 +177,7 @@ Field parameter:
177 177
 1. Label for the input box,
178 178
 2. Current text for the box,
179 179
 3. Help text for the input box.
180
+4. if set to "required" modern browser will check that this input box is filled when submitting the form,
180 181
 
181 182
 ### field_yesno.tpl
182 183
 

+ 1
- 1
view/templates/field_textarea.tpl View File

@@ -1,7 +1,7 @@
1 1
 
2 2
 	<div class="field textarea">
3 3
 		<label for="id_{{$field.0}}">{{$field.1}}</label>
4
-		<textarea name="{{$field.0}}" id="id_{{$field.0}}" aria-describedby="{{$field.0}}_tip">{{$field.2}}</textarea>
4
+		<textarea name="{{$field.0}}" id="id_{{$field.0}}" aria-describedby="{{$field.0}}_tip"{{if $field.4 eq 'required'}} required{{/if}}>{{$field.2}}</textarea>
5 5
 	{{if $field.3}}
6 6
 		<span class="field_help" role="tooltip" id="{{$field.0}}_tip">{{$field.3 nofilter}}</span>
7 7
 	{{/if}}

Loading…
Cancel
Save