The LimeSurvey Fund-Raiser 2012 is complete. Thank you for donating a total of 25,000 USD!     List of donors »

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

THEMA: radio/checkbox images workaround

radio/checkbox images workaround 3 Monate 1 Woche her #92417

  • adishardis
  • adishardiss Avatar
  • OFFLINE
  • Silver Donor
  • Beiträge: 57
  • Karma: 0
Hi,

I'm trying to apply this workaround to have images instead of the usual checkboxes/radio design. link

according to that I should replace "yourTemplateName" with your template directory name but I'm not sure exactly what line i'm supposed to edit?!
$(document).ready(function(){
	var templatePath = $('head link[href*="template.css"]').attr('href').replace(/template.css/, '');  
	// Apply images to radios 
	$('input[type="radio"]').imageTick({ 
		// Image to use as a selected state of the radio
		tick_image_path: templatePath+"radio.gif", 
		// Image to use as a non-selected state 
		no_tick_image_path: templatePath+"no_radio.gif", 
		// Class to apply to all radio images that are dynamically created 
		image_tick_class: "radios"
	}); 
 
	// Apply images to checkboxes 
	$('input[type="checkbox"]').imageTick({ 
		// Image to use as a selected state of the checkbox  
		tick_image_path: templatePath+"check.gif",  
		// Image to use as a non-selected state 
		no_tick_image_path: templatePath+"no_check.gif", 
		// Class to apply to all checkbox images that are dynamically created 
		image_tick_class: "checkboxes" 
	}); 
});

Peace
/Adam
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: radio/checkbox images workaround 3 Monate 1 Woche her #92446

  • DenisChenu
  • DenisChenus Avatar
  • ONLINE
  • Moderator Lime
  • Beiträge: 4377
  • Dank erhalten: 451
  • Karma: 165
Hello,

Think it's best to use a div for templatePath.

In the endpage.pstpl:
<div id="templatepath" style="display:none">{TEMPLATEURL}</div>
And replace
var templatePath = $('head link[href*="template.css"]').attr('href').replace(/template.css/, '');
by
var templatePath=$("#templatepath").html();

Denis
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: radio/checkbox images workaround 3 Monate 1 Woche her #92458

  • adishardis
  • adishardiss Avatar
  • OFFLINE
  • Silver Donor
  • Beiträge: 57
  • Karma: 0
Ok, now my source shows following error:

Uncaught TypeError: Object [object Object] has no method 'imageTick'

in template.js:48

Does that mean anything to you?

Here's a link to a test survey if you can see anything from that: survey.sevenday.se/survey/index.php/923757/lang-sv

Thanks
/Adam
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: radio/checkbox images workaround 3 Monate 1 Woche her #92486

  • DenisChenu
  • DenisChenus Avatar
  • ONLINE
  • Moderator Lime
  • Beiträge: 4377
  • Dank erhalten: 451
  • Karma: 165
You don't include imagetick.js

<script type="text/javascript" src="{TEMPLATEURL}imagetick_lime.js"></script>

Think it can be after TEMPLATEJS
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: adishardis
  • Seite:
  • 1
Moderatoren: DenisChenu, ITEd
Ladezeit der Seite: 0.280 Sekunden
Donation Image