surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.11k stars 801 forks source link

Multiple text hide row labels #7438

Open SamMousa opened 9 months ago

SamMousa commented 9 months ago

Are you requesting a feature, reporting a bug or asking a question?

Feature

What is the current behavior?

In research you have a question type called unaided brand awareness which requires multiple text inputs but has no real concept of rows.

What is the expected behavior?

I'd love a question type that supports this, currently the solution is to add empty labels   to each row, but that feels like an ugly workaround.

JaneSjs commented 9 months ago

Hi @SamMousa, Thank you for sharing your idea. I suppose that you wish to implement the following type of a question.

Q: When you think about [insert industry], what brands come to mind first? List up to 5.
[Text box #1]
[Text box #2]
[Text box #3]
[Text box #4]
[Text box #5]

Or, do you wish to implement other kind of a question? Please share an example.

SamMousa commented 9 months ago

That's exactly it! Functionality might include adding the rows dynamically, ie have a new text field automatically appear as soon as the last one is nonempty.

JaneSjs commented 9 months ago

Thank you for the clarification. Have you considered using a Multi-Selection Matrix or Dynamic Matrix with the Text cell input type?

SamMousa commented 9 months ago

Yes, but they take up a lot of space and we concluded that the "best" workaround for now is using multiple text with empty labels (or even just hiding the label using CSS). This is just not a very user friendly solution.

A checkbox option: don't show labels would also just solve the problem btw.

JaneSjs commented 9 months ago

Hi @SamMousa , Thank you for the clarification. I played around with different survey settings and managed to produce three alternatives.

You may notice that questions above look compact. This layout was produced by customizing a survey theme. The Scale (sjs-base-unit) parameter controls how much space will be around survey elements. You can also adjust other theme settings to produce the layout which best suits your needs. I created the following demo for your reference: View Plunker. It contains above question options and a customized theme file.

I hope either alternative may work for you. Please let me know if you have any further questions.

Thanks

SamMousa commented 9 months ago

Hi Jane,

That's really not the reason I make these tickets. I'm aware of the ways to work around it, note that customizing the theme would need to be done for every theme we use. Also it requires further knowledge if we only want to apply it to a specific question etc.

All of these solutions are workarounds; and in my original post I noted I already had one. The point is to make the library better, so I make suggestions.

If you think having a question type for this, or in this case a setting to hide labels, is not a good addition that's fine. But please don't waste your time on finding workarounds for my sake! The goal in my opinion is not for a developer (like me) to be able to create this question type, but for every user who goes to https://surveyjs.io/create-free-survey to simply do so.

Edit: my goal is not to reopen, just don't spend your valuable time on creating workarounds ;-)