]> git.mxchange.org Git - friendica.git/blobdiff - view/templates/acl/message_recipient.tpl
Prevent tagsinput select element to be submitted without a value when they are required
[friendica.git] / view / templates / acl / message_recipient.tpl
index 07c22f449e4fee59fbf6472d18eab333a991f36f..2c74ed178e9e7b04d3a0d460fc86070dffb5dd4e 100644 (file)
@@ -1,4 +1,4 @@
-<select name="recipient" class="form-control input-lg" id="recipient">
+<select name="recipient" class="form-control input-lg" id="recipient" required>
        {{foreach $contacts as $contact}}
                <option value="{{$contact.id}}"{{if $contact.id == $selected}} selected{{/if}}>{{$contact.name}}</option>
        {{/foreach}}
@@ -48,7 +48,9 @@
                        }
                });
 
+               {{if $selected}}
                // Import existing ACL into the tags input fields.
                $recipient_input.tagsinput('add', acl.get({{$selected}})[0]);
+               {{/if}}
        });
 </script>