Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: align textbox with question

align textbox with question 3 years 6 months ago #50930

  • stanner
  • stanner's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
I thought I had seen in the forums once a way to align the short free text box with the text of the questions, but I can't seem to find that solution, maybe I am crazy and it was never there. :unsure:

What I would like to do is align the text box with the question
eg:

Question 1 [Short Free Text]

instead of

Question 1
[Short Free Text]

and it would be really awesome if I could do the following

Question 1 [Short Free Text] Question 2 [Short Free Text]
Question 3 [Short Free Text] Question 4 [Short Free Text]

Etc . . . .


Thank you!
The administrator has disabled public write access.

Re:align textbox with question 3 years 6 months ago #50931

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
This can be done but requires quite some question specific CSS hacks.

If you just need this layout:
Question 1 [Short Free Text]

you can use a multiple short text question, add only one subquestion and add the question text at the subquestion.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re:align textbox with question 3 years 6 months ago #50988

  • stanner
  • stanner's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
Mazi,
I tried that but I run into two problems.
1. when the question is set to mandatory all fields become mandatory
2. in order to validate a specific set of questions,JavaScript must be used which means enabling XSS.

Since this section of the survey is basically a web form to fill in basic who are you information my preference would be to do something like:

Question 1 [Short Free Text] Question 2 [Short Free Text]

Are there any examples out there of what these question specific css hacks would look like?
The administrator has disabled public write access.

Re:align textbox with question 3 years 6 months ago #50989

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
There is an examples at workarounds (->JavaScript if I remember correctly).

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re:align textbox with question 3 years 6 months ago #50992

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2446
  • Thank you received: 254
  • Karma: 94
I think you did not understand the Mazis solution.

He suggests to use the question type "multiple short question text" but only with one subquestion per question. So you still would have various independent questions.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re:align textbox with question 3 years 6 months ago #50993

  • stanner
  • stanner's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
@ Mazi, is there any way to do it without using javascript? If I remember correctly using javascript with Limesurvey means that you have to enable XSS, which I can not do.

@holch, Yes you are correct I did misunderstand, however, validation is not available with "multiple short text questions" unless you use javascript. Unless javascript can be implemented without the use of XSS, I can not implement.

Thank you both for your quick replies.
The administrator has disabled public write access.

Re:align textbox with question 3 years 6 months ago #50998

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
When using the workaround you have to use Javascript.

When using the multiple short text alternative you don't need any JS.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re:align textbox with question 3 years 6 months ago #51003

  • stanner
  • stanner's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
I have created a few multiple short text questions with only one question each in them, but for the life of me I can't figure out how to get the validation to work.
The administrator has disabled public write access.

Re:align textbox with question 3 years 6 months ago #51004

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2446
  • Thank you received: 254
  • Karma: 94
I had a look at that as well and the only validation that I see is the possiblity to limit the number of characters.

Hmm, then the only option will be to play around with floats to align the question text and the input type. Not sure if this can be done with CSS only. There is a workaround that shows how to align different questions, but it also requires Javascript.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re:align textbox with question 3 years 6 months ago #51005

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5279
  • Thank you received: 289
  • Karma: 246
Validation isn't possible at a multiple short text question.

I'm not sure if it's possible, but what if you use a simple short text question and add the question text at the "prefix" question attributes (if this exists for this question type)?!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.157 seconds
Donation Image