17 $p = parent::validate( $value, $alldata );
24 # with the addition that a leading '+' sign is ok. Note that leading zeros
25 # are fine, and will be left in the input, which is useful for things like
26 # phone numbers when you know that they are integers (the HTML5 type=tel
27 # input does not require its value to be numeric). If you want a tidier
28 # value to, eg, save in the DB, clean it up with intval().
29 if ( !preg_match(
'/^((\+|\-)?\d+)?$/', trim( $value ??
'' ) ) ) {
30 return $this->
msg(
'htmlform-int-invalid' );
38class_alias( HTMLIntField::class,
'HTMLIntField' );