]> git.mxchange.org Git - friendica.git/commitdiff
add option 'require' for textarea form elements
authorTobias Diekershoff <tobias.diekershoff@gmx.net>
Wed, 2 Oct 2019 05:33:30 +0000 (07:33 +0200)
committerTobias Diekershoff <tobias.diekershoff@gmx.net>
Wed, 2 Oct 2019 05:33:30 +0000 (07:33 +0200)
doc/smarty3-templates.md
view/templates/field_textarea.tpl

index 599e3597e7554baf2e3c53dc3b3f262e6165832d..f174f216423d3f68385e7cc694eca992437a6fa1 100644 (file)
@@ -177,6 +177,7 @@ Field parameter:
 1. Label for the input box,
 2. Current text for the box,
 3. Help text for the input box.
+4. if set to "required" modern browser will check that this input box is filled when submitting the form,
 
 ### field_yesno.tpl
 
index eadcbe56c7d6ab806327eff4989e82ba4ff7e352..17b07266a9c22c85a85714d489cdac7813ce0107 100644 (file)
@@ -1,7 +1,7 @@
 
        <div class="field textarea">
                <label for="id_{{$field.0}}">{{$field.1}}</label>
-               <textarea name="{{$field.0}}" id="id_{{$field.0}}" aria-describedby="{{$field.0}}_tip">{{$field.2}}</textarea>
+               <textarea name="{{$field.0}}" id="id_{{$field.0}}" aria-describedby="{{$field.0}}_tip"{{if $field.4 eq 'required'}} required{{/if}}>{{$field.2}}</textarea>
        {{if $field.3}}
                <span class="field_help" role="tooltip" id="{{$field.0}}_tip">{{$field.3 nofilter}}</span>
        {{/if}}