Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Unwanted line break between mandatory asterisk and question text

Unwanted line break between mandatory asterisk and question text 2 Jahre 2 Tage her #87246

  • che
  • ches Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 21
  • 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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Unwanted line break between mandatory asterisk and question text 2 Jahre 2 Tage her #87247

  • lowprofile
  • lowprofiles Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 22
  • Dank erhalten: 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>
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Unwanted line break between mandatory asterisk and question text 2 Jahre 1 Tag her #87276

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4281
  • Dank erhalten: 807
  • Karma: 370
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Unwanted line break between mandatory asterisk and question text 2 Jahre 1 Tag her #87322

  • che
  • ches Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 21
  • 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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Unwanted line break between mandatory asterisk and question text 9 Monate 3 Wochen her #102985

  • mrli999
  • mrli999s Avatar
  • OFFLINE
  • Expert Lime
  • Beiträge: 95
  • Dank erhalten: 2
  • Karma: 0
Is there solution in limesurvey 2.05? thanks
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Unwanted line break between mandatory asterisk and question text 9 Monate 3 Wochen her #102987

  • mrli999
  • mrli999s Avatar
  • OFFLINE
  • Expert Lime
  • Beiträge: 95
  • Dank erhalten: 2
  • Karma: 0
Maybe you can check the "question" in source mode, if you can find <p></p>there, just delete it.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: mikeu

Unwanted line break between mandatory asterisk and question text 9 Monate 3 Wochen her #103008

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4281
  • Dank erhalten: 807
  • Karma: 370
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.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.209 Sekunden
Donation Image