Welcome, Guest
Username: Password: Remember me

TOPIC: Unwanted line break between mandatory asterisk and question text

Unwanted line break between mandatory asterisk and question text 1 year 11 months ago #87246

  • che
  • che's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 17
  • Karma: 0
Hello, I'm using the Basic template in LimeSurvey 2.00. I've edited the question.pstpl and here is what I think is the relevant part:
<table width="100%" cellspacing="0" cellpadding="8" border="0">
					<tr>
						<td class="be">
                                                  <span class="asterisk">{QUESTION_MANDATORY}</span><br />{QUESTION_TEXT}<br /><span class="questionhelp">{QUESTION_HELP}</span>
 
							{QUESTION_MAN_MESSAGE}
							{QUESTION_VALID_MESSAGE}
							{QUESTION_FILE_VALID_MESSAGE}
						</td>
					</tr>
        	        <!--<tr><td><font size="-1"><i>{QUESTIONHELPPLAINTEXT}</i></font></td></tr>-->
					<tr>
						<td width="100%" class="answer">{ANSWER}</td>
					</tr>
	                <tr>
						<td class="survey-question-help">{QUESTIONHELP}</td>
					</tr>
				</table>



The problem is that there is a line/paragraph break between the mandatory asterisk and the question text. Screenshot attached. I also looked in template.css but nothing seems to stand out.

Any help? Thanks much.

Che



Screenshot2012-10-23at11.54.33AM.png
The administrator has disabled public write access.

Re: Unwanted line break between mandatory asterisk and question text 1 year 11 months ago #87247

  • lowprofile
  • lowprofile's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 22
  • Thank you received: 1
  • Karma: 0
This is also the case for me, I would suspect its the phpeditor and the browser. Some browsers don't add it, firefox will if you save the question text directly in the regular phpUI.
If you are in the source and save it doesn't add the paragraph tag <p>
The administrator has disabled public write access.

Re: Unwanted line break between mandatory asterisk and question text 1 year 11 months ago #87276

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4207
  • Thank you received: 791
  • Karma: 360
I don't see any <p> tags in your script but I do see a line break after the .asterisk span.

Try changing this:
<span class="asterisk">{QUESTION_MANDATORY}</span><br />{QUESTION_TEXT}<br /><span class="questionhelp">{QUESTION_HELP}</span>

T this:
<span class="asterisk">{QUESTION_MANDATORY}</span>$nbsp{QUESTION_TEXT}<br /><span class="questionhelp">{QUESTION_HELP}</span>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Unwanted line break between mandatory asterisk and question text 1 year 11 months ago #87322

  • che
  • che's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 17
  • Karma: 0
@lowprofile -- thank you. It adds an extra step, but using the source works for me.

@tpartner -- thanks as well, but making that change didn't affect anything.

Thanks,
Che
The administrator has disabled public write access.

Unwanted line break between mandatory asterisk and question text 9 months 19 hours ago #102985

  • mrli999
  • mrli999's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 95
  • Thank you received: 2
  • Karma: 0
Is there solution in limesurvey 2.05? thanks
The administrator has disabled public write access.

Re: Unwanted line break between mandatory asterisk and question text 9 months 8 hours ago #102987

  • mrli999
  • mrli999's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 95
  • Thank you received: 2
  • Karma: 0
Maybe you can check the "question" in source mode, if you can find <p></p>there, just delete it.
The administrator has disabled public write access.
The following user(s) said Thank You: mikeu

Unwanted line break between mandatory asterisk and question text 8 months 4 weeks ago #103008

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4207
  • Thank you received: 791
  • Karma: 360
You can use JavaScript to automatically detect the <p> element and if found, move the <span class="asterisk"> element into that <p>

For all shipped templates except those listed below, add this to the end of template.js:
$(document).ready(function(){
	// Fix the asterisk placement
	$.fn.tagName = function() {
		return this.get(0).tagName;
	}
	$('span.asterisk').each(function(i){
		if($(this).next().next().length > 0 && $(this).next().next().tagName().toLowerCase() == 'p') {
			$(this).prependTo($(this).next().next());
		}
	});
 
});

For the bluengrey, sherpa and vallendar templates, use this:
$(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());
		}
	});
 
});

.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.180 seconds
Donation Image