Welcome, Guest
Username: Password: Remember me

TOPIC: Can't seem to turn javascript on

Can't seem to turn javascript on 3 years 1 month ago #81322

  • mosaic
  • mosaic's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Just installed limesurvey. It seems very impressive. Great work guys.

I am planning customize my array with a comment column, so I guess I need to resort to javascript. Something like the following:
*** R1 R2 R3 R4 R5 R6 Comments
Q1
Q2
Q3
Q4

with QiRj (i in [1,4] and j in [1, 6]) being radio buttons and last column being comments

However, I'm having a hard time to get it going.

I have turned Filter HTML for XSS off (NO) in global setting.

When I am doing the editing of a survey question, other than a popup editing screen with a box around it, there is nothing I can choose (as documented in the workaround documentation) the source code, specifically, there is no toolbar for the HTML editor.

I'm just wondering whether I've made a mistake in installation.

Hopefully I did not submit in the wrong forum topic. If so, please feel free to move it.

TIA
Last Edit: 3 years 1 month ago by mosaic.
The administrator has disabled public write access.

Can't seem to turn javascript on 3 years 1 month ago #81324

  • crafter
  • crafter's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 17
  • Thank you received: 1
  • Karma: 0
Add the Javascript to the HTML box that is part of the question description on the question edit screen.
The administrator has disabled public write access.

Can't seem to turn javascript on (resolved but with new questions) 3 years 1 month ago #81352

  • mosaic
  • mosaic's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
crafter,

Thanks for your help to get html editor turned on. For other people who is having the same issue right after installation, this is caused by the .htaccess in limesurvey\admin\scripts\ckeditor.36, in my server, I just have to remove the file. All is well.

The second part is to implement the JS to make it work:
    function sideBySide(tab0id, tabid, qid, row) {
        document.getElementById(qid).style.display='none';	  
        // document.getElementById(qid).css ( {'display': 'none'} );
        var table0 = document.getElementById('javatbd'+tab0id+'SQ001').parentNode;
        var table = document.getElementById('javatbd'+tabid+'SQ001').parentNode;
        var tr0 = table0.getElementsByTagName("TR");
        var tr = table.getElementsByTagName("TR");
        for(var i=0; i < row; i++) {
            //alert(tr[i].cells[1].outerHTML);
            tr0[i].innerHTML += tr[i].cells[1].outerHTML;
            //alert(tr0[i].innerHTML);
        }
	}
 
 

One more question, since I'm using this for more than one occasions, is it possible to include this function in a location once, that it can be used in more than one place?

I tried to include in: limesurvey\admin\scripts\template.js, but that does not seem to work.

Could someone point me to the right file to include this script? Currently I just added this function in every place that's been used, seems like a overkill.
Last Edit: 3 years 1 month ago by mosaic.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.152 seconds