- Posts: 7
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Asterisk displays on a seperate line for mandatory questions
- pvb8008
- Topic Author
- Offline
- New Member
Less
More
7 years 4 months ago #145139
by pvb8008
Asterisk displays on a seperate line for mandatory questions was created by pvb8008
I just did a clean install of Limesurvey 2.56.1.
I am using the default template for a very simple survey that has all questions as mandatory. In the template on some questions the asterisk is inline before the question (the way I want it). On other questions the asterisk is on its own line with the question below it.
The difference seems to be random. Some are inline and some are not. Is there a way to control this and have the asterisk inline?
(see screen shot)
Thanks!
Peter
I am using the default template for a very simple survey that has all questions as mandatory. In the template on some questions the asterisk is inline before the question (the way I want it). On other questions the asterisk is on its own line with the question below it.
The difference seems to be random. Some are inline and some are not. Is there a way to control this and have the asterisk inline?
(see screen shot)
Thanks!
Peter
Attachments:
The topic has been locked.
- holch
- Away
- LimeSurvey Community Team
Less
More
- Posts: 11658
- Thank you received: 2742
7 years 4 months ago #145140
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Asterisk displays on a seperate line for mandatory questions
Is there a difference between questions types?
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- pvb8008
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 1
7 years 4 months ago #145142
by pvb8008
Replied by pvb8008 on topic Asterisk displays on a seperate line for mandatory questions
@holch
No. I tried with the same long free text and with short free text--got the same outcome. The length of the question and the question type don't seem to make any difference. I looked to be sure there was no additional space or errant line break in the html code also. I looked in the manual but have not been able to locate where this is addressed.
Thanks,
Peter
No. I tried with the same long free text and with short free text--got the same outcome. The length of the question and the question type don't seem to make any difference. I looked to be sure there was no additional space or errant line break in the html code also. I looked in the manual but have not been able to locate where this is addressed.
Thanks,
Peter
The topic has been locked.
- Joffm
- Away
- LimeSurvey Community Team
Less
More
- Posts: 12923
- Thank you received: 3977
7 years 4 months ago #145147
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Asterisk displays on a seperate line for mandatory questions
Hi, Peter,
select "source code" in question text editor.
Very probably there is a <p> tag around the text.
Remove it at least from the first line.
Best regards
Joffm
select "source code" in question text editor.
Very probably there is a <p> tag around the text.
Remove it at least from the first line.
Best regards
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, gascon_alf
The topic has been locked.
- pvb8008
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 1
7 years 4 months ago #145149
by pvb8008
Replied by pvb8008 on topic Asterisk displays on a seperate line for mandatory questions
Indeed. The one's that were inline had no <p> tag. The one's that had the asterisk on a separate line had the <p> tag. I removed the paragraph tags (both open <p> and closed </p>) and all now are consistent. You saved me tons of time trying to sort this out.
THANK YOU!!
Peter
THANK YOU!!
Peter
The following user(s) said Thank You: gascon_alf
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
7 years 4 months ago - 7 years 4 months ago #145152
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Asterisk displays on a seperate line for mandatory questions
I use a JavaScript workaround like this to insert the asterisk into the <p> element (if found). It allows the unrestricted use of <p> elements.
Of course, then you also need to add a little margin for the asterisk.
Code:
$(document).ready(function() { // Fix the asterisk placement $.fn.tagName = function() { return this.get(0).tagName; } $('span.asterisk').each(function(i){ if($(this).next().length > 0 && $(this).next().tagName().toLowerCase() == 'p') { $(this).prependTo($(this).next()); } }); });
Of course, then you also need to add a little margin for the asterisk.
Code:
p span.asterisk { margin-right: 0.3em; }
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 4 months ago by tpartner.
The topic has been locked.
- pvb8008
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 1
7 years 4 months ago #145153
by pvb8008
Replied by pvb8008 on topic Asterisk displays on a seperate line for mandatory questions
Nice.
I see that this is an oddity in the program or theme that it puts the asterisk on its own line when using standard paragraph tags. So I must not be the only one who has encountered this.
Thanks.
Peter
I see that this is an oddity in the program or theme that it puts the asterisk on its own line when using standard paragraph tags. So I must not be the only one who has encountered this.
Thanks.
Peter
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
7 years 4 months ago #145155
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Asterisk displays on a seperate line for mandatory questions
The problem is that the asterisk is inserted at the template level (question.pstpl), not by the editor so there is no way of knowing what HTML elements will be in the question text.
<p> elements are block elements so will be rendered with a preceding line-break.
<p> elements are block elements so will be rendered with a preceding line-break.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- pvb8008
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 1
7 years 4 months ago #145157
by pvb8008
Replied by pvb8008 on topic Asterisk displays on a seperate line for mandatory questions
Noted.
Where are you putting the javascript? Which css file is the styling fix added to?
Peter
Where are you putting the javascript? Which css file is the styling fix added to?
Peter
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
7 years 4 months ago - 7 years 4 months ago #145158
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Asterisk displays on a seperate line for mandatory questions
Sorry, I should have included that.
- The JavaScript in template.js
- The CSS in template.css
- The JavaScript in template.js
- The CSS in template.css
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 4 months ago by tpartner.
The following user(s) said Thank You: pvb8008
The topic has been locked.
- DenisChenu
- Away
- LimeSurvey Community Team
Less
More
- Posts: 13643
- Thank you received: 2491
7 years 4 months ago #145165
by DenisChenu
It work on 2.6 version and 3.0 version.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Asterisk displays on a seperate line for mandatory questions
Why not with float:left css ?tpartner wrote: I use a JavaScript workaround like ....
It work on 2.6 version and 3.0 version.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
7 years 4 months ago #145181
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Asterisk displays on a seperate line for mandatory questions
Personal preference - I prefer to place it in the <p> element.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.