Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:
  • Seite:
  • 1
  • 2

THEMA: Adding another previous and next button at the top.

Adding another previous and next button at the top. 3 Jahre 9 Monate her #56383

  • blowe46
  • blowe46s Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 6
  • Karma: 0
Hi

Is it possible to add another previous and next bottom at the top of the page? Currently, there's only a previous and next button at the bottom of the page. Is there anyway of adding an extra set at the top of the page?

The image on top is where I would like to add the extra buttons ,and the the image at the bottom is where the buttons are at the moment.


Letzte Änderung: 3 Jahre 9 Monate her von blowe46.
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Adding another previous and next button at the top. 3 Jahre 9 Monate her #56403

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4372
  • Dank erhalten: 830
  • Karma: 381
Sure, you can add clones of the navigation buttons with JavaScript.

Add the following to the end of template.js. It will insert a new div after the progress bar and then insert clones of the nav buttons in the new div.
	$(document).ready(function() {
 
		// Insert a new div after the progress bar
		$('<div id="navigator2" />').insertAfter('#progress-wrapper');
 
		// Style the new div
		$('#navigator2').css({
			'text-align':'center'
		});
 
		// Insert clones of the nav buttons in the new div
		$('input.submit:eq(0)').clone().appendTo('#navigator2');
		$('input.submit:eq(2)').clone().appendTo('#navigator2');
 
	});

This example is for the default template in 1.90 or 1.91. The placement of the new div may need to be modified for other templates.


Untitled-1_2011-02-05.png
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.
Folgende Benutzer bedankten sich: blowe46

Re: Adding another previous and next button at the top. 3 Jahre 9 Monate her #56430

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6561
  • Dank erhalten: 871
  • Karma: 257
tpartner schrieb:
Sure, you can add clones of the navigation buttons with JavaScript.
Hello Tony,

Di the id on submit button don't make error in some situation ?
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Adding another previous and next button at the top. 3 Jahre 9 Monate her #56432

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4372
  • Dank erhalten: 830
  • Karma: 381
Not in my testing. Did you get an error? If so, we can change the ID.
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: Adding another previous and next button at the top. 3 Jahre 9 Monate her #56433

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6561
  • Dank erhalten: 871
  • Karma: 257
If it's work it's OK :) (i didn't test it).

Just some bad validation ;)
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Adding another previous and next button at the top. 3 Jahre 9 Monate her #56436

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4372
  • Dank erhalten: 830
  • Karma: 381
Okay, you shamed me into it - here's the code to give them new IDs:
$(document).ready(function() {
 
		// Insert a new div after the progress bar
		$('<div id="navigator2" />').insertAfter('#progress-wrapper');
 
		// Style the new div
		$('#navigator2').css({
			'text-align':'center'
		});
 
		// Insert clones of the nav buttons in the new div
		$('input.submit:eq(0)').clone().appendTo('#navigator2');
		$('input.submit:eq(2)').clone().appendTo('#navigator2');
 
		// Give the new buttons some new IDs
		$('#navigator2 input.submit').each(function(i) {
			var oldID = $(this).attr('id');
			var newID = oldID + '2';
			$(this).attr('id', newID)
		});
 
	});
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: Adding another previous and next button at the top. 3 Jahre 9 Monate her #56438

  • Mazi
  • Mazis Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 5426
  • Dank erhalten: 307
  • Karma: 252
Wouldn't it be easier to just edit the template and place a second {NAVIGATOR} placeholder at the according place in the template?

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'"
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Adding another previous and next button at the top. 3 Jahre 9 Monate her #56440

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4372
  • Dank erhalten: 830
  • Karma: 381
That's been tried but it doesn't work unless the navigator originates in navigator.pstpl.
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: Adding another previous and next button at the top. 3 Jahre 9 Monate her #56601

  • Mazi
  • Mazis Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 5426
  • Dank erhalten: 307
  • Karma: 252
tpartner schrieb:
That's been tried but it doesn't work unless the navigator originates in navigator.pstpl.
Thanks, didn't know about it.

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'"
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Adding another previous and next button at the top. 3 Jahre 6 Monate her #61510

  • badronald
  • badronalds Avatar
  • OFFLINE
  • Senior Lime
  • Beiträge: 48
  • Karma: 0
I can get the new buttons to appear but on the previous button is functional. The next button does nothing. Not error message appears either in the error console.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
  • Seite:
  • 1
  • 2
Moderatoren: ITEd
Ladezeit der Seite: 0.181 Sekunden
Donation Image