Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

input_type_hidden #1379

Closed
awinogradov opened this issue Feb 26, 2015 · 15 comments
Closed

input_type_hidden #1379

awinogradov opened this issue Feb 26, 2015 · 15 comments

Comments

@awinogradov
Copy link
Member

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.

@tadatuta
Copy link
Member

@verybigman 'coz you may use

{ tag: 'input', attrs: { type: 'hidden' } }

instead ;)

@awinogradov
Copy link
Member Author

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
#1379 (comment).

@tadatuta
Copy link
Member

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.

@awinogradov
Copy link
Member Author

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.

@qfox
Copy link
Member

qfox commented Feb 27, 2015

@verybigman You just stick to HTML inputs. Free your mind of it!

@awinogradov
Copy link
Member Author

@zxqfox hast thou not been for the degradation to normal form post ;)

@awinogradov
Copy link
Member Author

There is some argument for not doing this modifier? We can add it in bem-forms if here it is superfluous.

@tadatuta
Copy link
Member

@verybigman can you provide examples of usage?

@awinogradov
Copy link
Member Author

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:)

@tadatuta
Copy link
Member

are you sure that's the best way? ;)
please describe the whole task.

@awinogradov
Copy link
Member Author

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.

@tadatuta
Copy link
Member

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?

@awinogradov
Copy link
Member Author

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:)

@tadatuta
Copy link
Member

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.

@awinogradov
Copy link
Member Author

Problem will be solved in bem-forms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants