Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Search Results (Searched for: html)

  • danika
  • danika's Avatar
25 Jun 2014 16:50 - 25 Jun 2014 16:51
Replied by danika on topic HTML tags
For the benefit of those reading the thread, Ben_V's suggestion worked like a charm.

Cheers!
  • danika
  • danika's Avatar
25 Jun 2014 16:30
Replied by danika on topic HTML tags
Thanks everyone for the several suggestions. I am sure that along with this I'll be able to resolve the issue of style tags displaying in the browser tabs.

Best -

Dani
  • DenisChenu
  • DenisChenu's Avatar
25 Jun 2014 14:59 - 25 Jun 2014 15:01
Replied by DenisChenu on topic HTML tags
With Ben_V explanation, i better understand now ....

In startpage.pspl : try :
Code:
<title>{strip_tags(SURVEYNAME GROUPNAME)}</title>

PS: it's not the browser tab : but the page title.
PS2: Benoit : you never remind to use EM before JS ;)
  • Ben_V
  • Ben_V's Avatar
25 Jun 2014 14:28
Replied by Ben_V on topic HTML tags
Hi,

As said by Tony and Denis, there is no difficulty in applying styles directly somewhere in the template

There is no good reason to use html tags in the title.... excepting for <sup></sup> and <sub></sub>, but as you have already noticed, those tags will appear in the browser title....

People really needing some survey title like: " Survey about CO2 ",
can try to use <sub></sub> tags in the survey name and control browser title using javascript:
Code:
<script type="text/javascript" charset="utf-8">
var newtitle = " Survey about CO2 ";
function ChangeTitle() { document.title = newtitle; } ChangeTitle();
</script>
  • DenisChenu
  • DenisChenu's Avatar
25 Jun 2014 13:34
Replied by DenisChenu on topic HTML tags

danika wrote: To answer your question about what is a browser tab, there is a good technical description of tabs, their history and development found here .

I think there are a lack of explanation here ...

For LS admin part ? For LS public part (taking survey).

What do you want to change ?

Please provide some screenshot or mockup.
  • DenisChenu
  • DenisChenu's Avatar
25 Jun 2014 13:31
Replied by DenisChenu on topic how to use html tag in EM?
Like you wrote (in 2.05)
  • iscar
  • iscar's Avatar
25 Jun 2014 13:10
how to use html tag in EM? was created by iscar
how to write EM with html tag like {if(q1=='yes','<p>yes</p>','<strong>no<//strong>')}?
  • tpartner
  • tpartner's Avatar
25 Jun 2014 12:08
Replied by tpartner on topic HTML tags
You cannot use HTML tags in the survey title. If you need to change the way it is displayed, you can modify the template files - template.css and/or startpage.pstpl.
  • danika
  • danika's Avatar
25 Jun 2014 11:41 - 25 Jun 2014 11:42
Replied by danika on topic HTML tags
Hi Denis,

I suspected it was there somewhere, but didn't know where exactly to look. Will have a look and see what we can do. However, applying HTML directly to text elements should not be, and ordinarily are not, interpreted this way. This might be considered a minor 'bug' for the developers to look at.

To answer your question about what is a browser tab, there is a good technical description of tabs, their history and development found here .

Thanks kindly!
  • BCorfman
  • BCorfman's Avatar
25 Jun 2014 10:20 - 25 Jun 2014 11:19
Google maps and previous maps answers was created by BCorfman
Hello,

I'm trying to implement a survey where someone picks a location on one map, and then picks a location on another map, and it calculates the distance between those two points.

To do this I'm attempting to implement a modified version of tpartner's code from this page: www.limesurvey.org/en/community-services...on?start=10&start=20


But no matter what I try, I can't get this to work. I have absolutely no experience with Javascript so I've been trying to stumble my way through it, but can't figure it out. Here is the code I modified and attached to question 2:
Code:
<script type="text/javascript" charset="utf-8">  
 
  $(document).ready(function(){
 
    // Identify the map
    var map2SGQA = '{SGQ}';
    var map1SGQA = '774328X12X32';
    var currentMap = gmaps[''+map2SGQA+'_c'];
 
 
    // Wait for the map to load
    google.maps.event.addListenerOnce(currentMap, 'idle', function(){ 
 
      // Some variable definitions
      var currentMarker = gmaps['marker__'+map2SGQA+'_c'];
      var answerInput = $('#answer'+map2SGQA+'_c');
      var defaultPosition = $(answerInput).val();
      var startLat = $('{INSERTANS:'+map1SGQA+'}').val().split(';')[0];
      var startLng = $('{INSERTANS:'+map1SGQA+'}').val().split(';')[1];
      var startLatLng = new google.maps.LatLng(startLat, startLng);
      var originIcon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&amp;chld=O|FFFF00|000000';
 
 
      // Listener on the map events
      google.maps.event.addListener(currentMap, 'click', function() {
        calculateDistances(startLatLng, currentMarker.getPosition());
      });
      google.maps.event.addListener(currentMarker, 'dragend', function() {
        calculateDistances(startLatLng, currentMarker.getPosition());
      });
      google.maps.event.addListener(currentMap, 'rightclick', function() {
        calculateDistances(startLatLng, currentMarker.getPosition());
      });
 
      // Insert the results element
      $(answerInput).after('<div class="distanceResults" />');
 
    });
  });
 
  function calculateDistances(origin, destination) {
    var service = new google.maps.DistanceMatrixService();
    service.getDistanceMatrix({
      origins: [origin],
      destinations: [destination],
      travelMode: google.maps.TravelMode.DRIVING,
      unitSystem: google.maps.UnitSystem.METRIC,
      avoidHighways: false,
      avoidTolls: false
    }, callback);
  }
 
  function callback(response, status) {
    if (status != google.maps.DistanceMatrixStatus.OK) {
      alert('Error was: ' + status);
    } else {
      var origins = response.originAddresses;
      var destinations = response.destinationAddresses;
 
      var outputDiv = $('.questiontext');
      outputDiv.innerHTML = '';
 
      for (var i = 0; i < origins.length; i++) {
        var results = response.rows[i].elements;
        for (var j = 0; j < results.length; j++) {
          $('.distanceResults').html('Start address: '+origins[i]+'<br />\
                        End address: '+destinations[j]+'<br />\
                        Distance: '+results[j].distance.text+'<br />\
                        Time: '+results[j].duration.text+'');
        }
      }
    }
  }
</script>


I could also see doing this by setting the start point of the second map to the answer of the first map, but because of how map questions output answers I can't figure out how to get that to work either.


Edit:

When putting both maps on the same page and using the following code, I have gotten this to work somewhat. Unfortunately it won't change the starting location after it has tried calculating everything once, so if anyone has any suggestions there I'd like to fix that.
Code:
<script type="text/javascript" charset="utf-8">  
 
  $(document).ready(function(){
 
    // Identify the map
    var map2SGQA = '{SGQ}';
    var map1SGQA = '774328X12X32';
    var currentMap = gmaps[''+map2SGQA+'_c'];
    var prevMap = gmaps[''+map1SGQA+'_c'];
 
 
    // Wait for the map to load
    google.maps.event.addListenerOnce(currentMap, 'idle', function(){ 
 
      // Some variable definitions
      var currentMarker = gmaps['marker__'+map2SGQA+'_c'];
      var prevMarker = gmaps['marker__'+map1SGQA+'_c'];
      var answerInput = $('#answer'+map2SGQA+'_c');
      var defaultPosition = $(answerInput).val();
      var startLat = $('#answer'+map1SGQA+'_c').val().split(' ')[0];
      var startLng = $('#answer'+map1SGQA+'_c').val().split(' ')[1];
      var startLatLng = new google.maps.LatLng(startLat, startLng);
      var originIcon = 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&amp;chld=O|FFFF00|000000';
 
 
      // Listener on the map events
      google.maps.event.addListener(prevMap, 'click', function() {
        startLatLng = prevMarker.getPosition();
      });
      google.maps.event.addListener(prevMarker, 'dragend', function() {
        startLatLng = prevMarker.getPosition();
      });
      google.maps.event.addListener(prevMap, 'rightclick', function() {
        startLatLng = prevMarker.getPosition();
      });
 
      google.maps.event.addListener(currentMap, 'click', function() {
        calculateDistances(startLatLng, currentMarker.getPosition());
      });
      google.maps.event.addListener(currentMarker, 'dragend', function() {
        calculateDistances(startLatLng, currentMarker.getPosition());
      });
      google.maps.event.addListener(currentMap, 'rightclick', function() {
        calculateDistances(startLatLng, currentMarker.getPosition());
      });
 
      // Insert the results element
      $(answerInput).after('<div class="distanceResults" />');
 
    });
  });
 
  function calculateDistances(origin, destination) {
    var service = new google.maps.DistanceMatrixService();
    service.getDistanceMatrix({
      origins: [origin],
      destinations: [destination],
      travelMode: google.maps.TravelMode.DRIVING,
      unitSystem: google.maps.UnitSystem.METRIC,
      avoidHighways: false,
      avoidTolls: false
    }, callback);
  }
 
  function callback(response, status) {
    if (status != google.maps.DistanceMatrixStatus.OK) {
      alert('Error was: ' + status);
    } else {
      var origins = response.originAddresses;
      var destinations = response.destinationAddresses;
 
      var outputDiv = $('.questiontext');
      outputDiv.innerHTML = '';
 
      for (var i = 0; i < origins.length; i++) {
        var results = response.rows[i].elements;
        for (var j = 0; j < results.length; j++) {
          $('.distanceResults').html('Start address: '+origins[i]+'<br />\
                        End address: '+destinations[j]+'<br />\
                        Distance: '+results[j].distance.text+'<br />\
                        Time: '+results[j].duration.text+'');
        }
      }
    }
  }
</script>
  • DenisChenu
  • DenisChenu's Avatar
25 Jun 2014 09:01
Replied by DenisChenu on topic HTML tags
Hi,

Really don't understand. What is the browser tab ? To increse heigth of the title, you can update the template directly : grouptitle.pstpl for example.

Denis
  • danika
  • danika's Avatar
25 Jun 2014 05:03 - 25 Jun 2014 05:05
HTML tags was created by danika
Hi,

I've noticed that html tags placed in the survey title show up in browser tabs. To increase the size of the title I tagged it with the <h2></h2> tags, and they now show in the browser tab. If there is a suggested work around I would be interested in hearing it? Version is 2.05+ and browser is FF 30.0.

Cheers
  • tpartner
  • tpartner's Avatar
24 Jun 2014 12:30
Replied by tpartner on topic IBAN and SWIFT validation
UN/CEFACT offers a JavaScript validation for IBANs - www.tbg5-finance.org/?ibandocs.shtml
  • iscar
  • iscar's Avatar
23 Jun 2014 16:53
Replied by iscar on topic can i use html in EM?
but the result is no

  • tpartner
  • tpartner's Avatar
23 Jun 2014 11:45
Replied by tpartner on topic can i use html in EM?
Yes.
Displaying 4711 - 4725 out of 4957 results.

Lime-years ahead

Online-surveys for every purse and purpose