Skip to content

Commit

Permalink
added pattern attribute in input
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Grand committed Oct 9, 2015
1 parent 657b27e commit e09cdb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/nitro.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
-record(textarea, {?ELEMENT_BASE(element_textarea), autofocus, cols, dirname, disabled, form, maxlength, name, placeholder, readonly, required, rows, wrap, value}).

% HTML Form inputs
-record(input, {?ELEMENT_BASE(element_input), autofocus, disabled, form, name, value, type=[], placeholder, multiple, min, max}).
-record(input, {?ELEMENT_BASE(element_input), autofocus, disabled, form, name, value, type=[], placeholder, multiple, min, max, pattern}).
-record(input_button, {?ELEMENT_BASE(element_input_button), autofocus, disabled, form, name, value}).
-record(checkbox, {?ELEMENT_BASE(element_checkbox), autofocus, checked=false, disabled, form, name, required, value}).
-record(color, {?ELEMENT_BASE(element_color), autocomplete, autofocus, disabled, form, list, name, value}).
Expand Down
1 change: 1 addition & 0 deletions src/elements/element_input.erl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ render_element(Record) ->
{<<"placeholder">>,Record#input.placeholder},
{<<"min">>, Record#input.min},
{<<"multiple">>, Record#input.multiple },
{<<"pattern">>,Record#input.pattern},
{<<"value">>, nitro:js_escape(Record#input.value)},
{<<"onkeypress">>, nitro:js_escape(Record#input.onkeypress)},
{<<"onkeyup">>, nitro:js_escape(Record#input.onkeyup)},
Expand Down

0 comments on commit e09cdb8

Please sign in to comment.