HTML5 require the fields when enforce is on

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2021-04-06 18:46:17 +02:00
parent 0cf04c3c3c
commit 20b4e3b86f
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
2 changed files with 4 additions and 2 deletions

View File

@ -236,8 +236,10 @@ class RegisterController extends Controller {
'loginname' => $loginname,
'fullname' => $fullname,
'show_fullname' => $this->config->getAppValue('registration', 'show_fullname', 'no') === 'yes',
'enforce_fullname' => $this->config->getAppValue('registration', 'enforce_fullname', 'no') === 'yes',
'phone' => $phone,
'show_phone' => $this->config->getAppValue('registration', 'show_phone', 'no') === 'yes',
'enforce_phone' => $this->config->getAppValue('registration', 'enforce_phone', 'no') === 'yes',
'message' => $message,
'password' => $password,
'additional_hint' => $additional_hint,

View File

@ -45,7 +45,7 @@ script('registration', 'registration-form');
<p class="groupmiddle">
<input type="text" name="fullname" id="fullname" value="<?php if (!empty($_['fullname'])) {
p($_['fullname']);
} ?>" placeholder="<?php p($l->t('Full name')); ?>" />
} ?>" placeholder="<?php p($l->t('Full name')); ?>" <?php if ($_['enforce_fullname']) { p('required'); } ?> />
<label for="fullname" class="infield"><?php p($l->t('Full name')); ?></label>
<img id="fullname-icon" class="svg" src="<?php print_unescaped(image_path('', 'actions/user.svg')); ?>" alt=""/>
</p>
@ -57,7 +57,7 @@ script('registration', 'registration-form');
<p class="groupmiddle">
<input type="text" name="phone" id="phone" value="<?php if (!empty($_['phone'])) {
p($_['phone']);
} ?>" placeholder="<?php p($l->t('Phone number')); ?>" />
} ?>" placeholder="<?php p($l->t('Phone number')); ?>" <?php if ($_['enforce_phone']) { p('required'); } ?> />
<label for="phone" class="infield"><?php p($l->t('Phone number')); ?></label>
<img id="phone-icon" class="svg" src="<?php print_unescaped(image_path('', 'clients/phone.svg')); ?>" alt=""/>
</p>