Closed awinogradov closed 9 years ago
@verybigman 'coz you may use
{ tag: 'input', attrs: { type: 'hidden' } }
instead ;)
Yes, I can:) but also I can { tag: 'input', attrs: { type: 'password' } } :) I want use hidden input with api, like other inputs. And add attributes like for other inputs. Why not?
Чт, 26 февр. 2015 г. в 15:47, Vladimir Grinenko notifications@github.com:
@verybigman https://github.com/verybigman 'coz you may use
{ tag: 'input', attrs: { type: 'hidden' } }
instead ;)
— Reply to this email directly or view it on GitHub https://github.com/bem/bem-components/issues/1379#issuecomment-76172265.
i think you need block control
with { tag: 'input', attrs: { type: 'hidden' } }
, don't you?
block input
has some things which are useless for <input type="hidden">
, e.g. https://github.com/bem/bem-components/blob/v2/common.blocks/input/input.bemhtml#L7 so in case of adding such modifier, biggest part of code would be to cancel previous declarations.
Ok, we don't need wrappers for control
like other input
blocks. But what is bad is to write a template modifier without wrappers? We want a consistent interaction with entities of the same type.
@verybigman You just stick to HTML inputs. Free your mind of it!
@zxqfox hast thou not been for the degradation to normal form post ;)
There is some argument for not doing this modifier? We can add it in bem-forms if here it is superfluous.
@verybigman can you provide examples of usage?
Yes! For example i use hidden input for type of value in another input. When value in another input is changes i change type in hidden input:)
are you sure that's the best way? ;) please describe the whole task.
Yes. Server wait two fields. First is value, where can be number or string. Second is value type field (hidden). Users can't edit type, they edit value with mask.
First of all you can never trust anything from client side so you have to check all user input on server side anyway. And as so why not just get type on server and get rid of that second field at all?
I think the conversation did not go there:) We have of course server validation. But we think here about front-end. In addition to the expectations of the server with hidden fields containing types or something else related interface blocks. The fields in the form can be dynamic, that is to appear and disappear. A intermediate data must also be stored somewhere. And with all this, you should be able to do a normal post request:)
In case in just need to hide some parts of form and still post it's values to server (which is far from previous examples ;)) you can just use display: hidden
in CSS, can't you?
I want detailed real-life example of the situation when you really need input type="hidden"
as an instance of input
BEM block. Now I believe it's unnecessary because in my practice there's no such cases.
Problem will be solved in bem-forms
Hi, guys!:) What about this #554 issue? We work on bem-forms library and base form fields on bem-components inputs. Now we think about hidden form fields and we need to
input_type_hidden
:) I know you close issue about this. Why? This mod would be realized in v2, but it is not.