I have inherited a Lime system that has a custom template. The template creates questions that result in an array with answers (i.e. one question has multiple answers), and there are multiple answers for the question (i.e. one question could have answer 1: a, b, c, d and answer 2: x, y, z), organized as a table on the page. When I look at the DOM after the survey is generated I see there are 10 potential answers (rows in the table), and all but the first is hidden. There is an 'Add row' button that unhides a row when clicked. What I need to do is have the survey rendered with the first 3 answers shown. I tried to do this in the document ready function - there the table exists but has no rows. I do not see any code in the custom template that created the rows of the table. Are the rows added in some lime code? Where would I put my code to unhide 3 rows of this table?
Sorry if this is not clear, this is my first experience with lime so please bear with me.
If you have an 'Add row' button, you have a custom JavaScript workaround applied. If you disable that workaround, you should see all rows (sub-questions) defined in the LimeSurvey admin interface.
Cheers,
Tony Partner Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
I do not want to display all the rows (there are 10), only the first 3. What is confusing me is that in the document ready function the table has no rows, but then if I inspect the DOM after the page is rendered it has 10 rows. Where would those rows get created?
I'm not sure what you are looking at but the rows are created server-side before the page is loaded. They may be hidden by CSS or JavaScript in your custom theme.
Thanks - I got this sorted out and working. One thing I had trouble with is installing the new template.js file. I tried to upload it in the template editor, but my update did not take - nothing was changed after uploading. On the deployed system I found the template.js file in either 2 or 3 different locations (differing by deployed system) - not counting the 4, 5, 6, or 7 tmp dirs. First I updated the file in all the places I found it (not including the tmp dir), but the changes were not seen by lime. Tried restarting, logging out, removing the tmp dir (which caused lime to not run), but no matter what, no joy. The only way I could get it deployed was to put it directly in the tmp dir it was being served out of. That does not seem like the correct thing to do, but I hope whenever that tmp dir gets updated or changed it will pick up the new file from one of the 3 places it exists at.
From looking at the image you showed in a previous post in this thread, I see that your editor (and therefore your LimeSurvey installation) is from a version earlier than 3.0
You might have to clear the cache via FTP (or update your installation to the most currect version).
Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl