Skip to content

Commit

Permalink
feature(views): login and register form now have html5 required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalsem committed Jun 30, 2015
1 parent d95dd38 commit f8c505c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
21 changes: 13 additions & 8 deletions views/default/forms/login.php
Expand Up @@ -9,16 +9,23 @@

<div>
<label><?php echo elgg_echo('loginusername'); ?>
<?php echo elgg_view('input/text', array(
'name' => 'username',
'autofocus' => true,
<?php
echo elgg_view('input/text', array(
'name' => 'username',
'autofocus' => true,
'required' => true
));
?>
</label>
</div>
<div>
<label><?php echo elgg_echo('password'); ?>
<?php echo elgg_view('input/password', array('name' => 'password')); ?>
<?php
echo elgg_view('input/password', array(
'name' => 'password',
'required' => true
));
?>
</label>
</div>

Expand All @@ -30,15 +37,13 @@
<?php echo elgg_echo('user:persistent'); ?>
</label>

<?php echo elgg_view('input/submit', array('value' => elgg_echo('login'))); ?>
<?php
echo elgg_view('input/submit', array('value' => elgg_echo('login')));

<?php
if (isset($vars['returntoreferer'])) {
echo elgg_view('input/hidden', array('name' => 'returntoreferer', 'value' => 'true'));
}
?>

<?php
echo elgg_view_menu('login', array(
'sort_by' => 'priority',
'class' => 'elgg-menu-general elgg-menu-hz mtm',
Expand Down
5 changes: 5 additions & 0 deletions views/default/forms/register.php
Expand Up @@ -26,6 +26,7 @@
'name' => 'name',
'value' => $name,
'autofocus' => true,
'required' => true
));
?>
</div>
Expand All @@ -35,6 +36,7 @@
echo elgg_view('input/text', array(
'name' => 'email',
'value' => $email,
'required' => true
));
?>
</div>
Expand All @@ -44,6 +46,7 @@
echo elgg_view('input/text', array(
'name' => 'username',
'value' => $username,
'required' => true
));
?>
</div>
Expand All @@ -53,6 +56,7 @@
echo elgg_view('input/password', array(
'name' => 'password',
'value' => $password,
'required' => true
));
?>
</div>
Expand All @@ -62,6 +66,7 @@
echo elgg_view('input/password', array(
'name' => 'password2',
'value' => $password2,
'required' => true
));
?>
</div>
Expand Down

0 comments on commit f8c505c

Please sign in to comment.