1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 04:12:00 +02:00

Html5 validation fixes. Admin SiteLinks for admin-ui now using $frm->url(); for URLs.

This commit is contained in:
Cameron
2015-02-01 17:28:38 -08:00
parent 274069184f
commit ee1623e747
6 changed files with 36 additions and 48 deletions

View File

@@ -338,8 +338,15 @@ class e_form
}
/**
* Same as $this->text() except it adds input validation for urls.
* At this stage, checking only for spaces. Should include sef-urls.
*/
function url($name, $value = '', $maxlength = 80, $options= array())
{
$options['pattern'] = '^\S*$';
return $this->text($name, $value, $maxlength, $options);
}
/**
* Text-Field Form Element
@@ -3559,6 +3566,11 @@ class e_form
break;
case 'url':
$maxlength = vartrue($parms['maxlength'], 255);
unset($parms['maxlength']);
$ret = vartrue($parms['pre']).$this->url($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true
break;
// case 'email':
case 'text':
case 'password': // encrypts to md5 when saved.