Skip to content

Commit

Permalink
Default values for form inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy-1 committed Oct 25, 2022
1 parent da170f7 commit b66caa3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions templates/frontend/components/loginForm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{translate key="common.required"}
</span>
</label>
<input type="text" class="form-control" name="username" id="{$usernameId}" value="{$username|escape}"
<input type="text" class="form-control" name="username" id="{$usernameId}" value="{$username|default:""|escape}"
maxlength="32" autocomplete="username" required>
</div>
<div class="form-group form-group-password">
Expand All @@ -47,7 +47,7 @@
{translate key="common.required"}
</span>
</label>
<input type="password" class="form-control" name="password" id="{$passwordId}" value="{$password|escape}"
<input type="password" class="form-control" name="password" id="{$passwordId}" value="{$password|default:""|escape}"
maxlength="32" autocomplete="current-password" required>
</div>
<div class="row">
Expand Down
10 changes: 5 additions & 5 deletions templates/frontend/components/registrationForm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
{translate key="common.required"}
</span>
</label>
<input class="form-control" type="text" name="givenName" id="givenName" autocomplete="given-name" value="{$givenName|escape}" maxlength="255" required>
<input class="form-control" type="text" name="givenName" id="givenName" autocomplete="given-name" value="{$givenName|default:""|escape}" maxlength="255" required>
</div>
<div class="form-group">
<label for="familyName">
{translate key="user.familyName"}
</label>
<input class="form-control" type="text" name="familyName" id="familyName" autocomplete="family-name" value="{$familyName|escape}" maxlength="255">
<input class="form-control" type="text" name="familyName" id="familyName" autocomplete="family-name" value="{$familyName|default:""|escape}" maxlength="255">
</div>
<div class="form-group">
<label for="affiliation">
Expand All @@ -46,7 +46,7 @@
{translate key="common.required"}
</span>
</label>
<input class="form-control" type="text" name="affiliation" id="affiliation" autocomplete="organization" value="{$affiliation|escape}" required>
<input class="form-control" type="text" name="affiliation" id="affiliation" autocomplete="organization" value="{$affiliation|default:""|escape}" required>
</div>
<div class="form-group">
<label for="country">
Expand Down Expand Up @@ -76,7 +76,7 @@
{translate key="common.required"}
</span>
</label>
<input class="form-control" type="email" name="email" id="email" value="{$email|escape}" maxlength="90" autocomplete="email" required>
<input class="form-control" type="email" name="email" id="email" value="{$email|default:""|escape}" maxlength="90" autocomplete="email" required>
</div>
<div class="form-group">
<label for="username">
Expand All @@ -86,7 +86,7 @@
{translate key="common.required"}
</span>
</label>
<input class="form-control" type="text" name="username" id="username" value="{$username|escape}" maxlength="32" autocomplete="username" required>
<input class="form-control" type="text" name="username" id="username" value="{$username|default:""|escape}" maxlength="32" autocomplete="username" required>
</div>
<div class="form-group">
<label for="password">
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/pages/userRegister.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<form class="form-register" id="register" method="post" action="{url op="register"}">
{csrf}
<input type="hidden" name="source" value="{$source|escape}" />
<input type="hidden" name="source" value="{$source|default:""|escape}" />

{include file="common/formErrors.tpl"}

Expand Down

0 comments on commit b66caa3

Please sign in to comment.