Browse Source

added accept attribute into input

G-Grand 9 years ago
parent
commit
4f46bdbf44
2 changed files with 2 additions and 1 deletions
  1. 1 1
      include/nitro.hrl
  2. 1 0
      src/elements/element_input.erl

+ 1 - 1
include/nitro.hrl

@@ -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, pattern}).
+-record(input,       {?ELEMENT_BASE(element_input),  autofocus, disabled, form, name, value, type=[], placeholder, multiple, min, max, pattern, accept}).
 -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}).

+ 1 - 0
src/elements/element_input.erl

@@ -35,6 +35,7 @@ render_element(Record) ->
       {<<"disabled">>, if Record#input.disabled == true -> "disabled"; true -> undefined end},
       {<<"name">>,Record#input.name},
       {<<"type">>, Record#input.type},
+      {<<"accept">>, Record#input.accept},
       {<<"max">>, Record#input.max},
       {<<"placeholder">>,Record#input.placeholder},
       {<<"min">>, Record#input.min},