Permalink
Browse files

feature(views): login and register form now have html5 required fields

  • Loading branch information...
jdalsem committed Jun 30, 2015
1 parent d95dd38 commit f8c505caadcfd958b98f0daf7d796c05e340f4c1
Showing with 18 additions and 8 deletions.
  1. +13 −8 views/default/forms/login.php
  2. +5 −0 views/default/forms/register.php
@@ -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>
@@ -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',
@@ -26,6 +26,7 @@
'name' => 'name',
'value' => $name,
'autofocus' => true,
+ 'required' => true
));
?>
</div>
@@ -35,6 +36,7 @@
echo elgg_view('input/text', array(
'name' => 'email',
'value' => $email,
+ 'required' => true
));
?>
</div>
@@ -44,6 +46,7 @@
echo elgg_view('input/text', array(
'name' => 'username',
'value' => $username,
+ 'required' => true
));
?>
</div>
@@ -53,6 +56,7 @@
echo elgg_view('input/password', array(
'name' => 'password',
'value' => $password,
+ 'required' => true
));
?>
</div>
@@ -62,6 +66,7 @@
echo elgg_view('input/password', array(
'name' => 'password2',
'value' => $password2,
+ 'required' => true
));
?>
</div>

0 comments on commit f8c505c

Please sign in to comment.