Hey guys,
I happen to be trying exactly the same thing. However, although the code runs without any errors indicated by Firebug, nothing happens. Sadly, however, I don't actually know Javascript. I know PHP a bit, but I'm not sure what's happening here, so I basically get stuck pretty quickly trying to debug :-/
This is what I have so far. The question is just an 'array' question type (i.e. radiobuttons). Maybe I misunderstood the original question (because why would anything say "No answer" with this question type?), but as you may understand already, I'm not overly secure about my understanding of Limesurvey or Javascript :-/
This is the code I use now:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
var qID = '68955X75X1426';
var originalText = 'No answer';
var newText ='1';
$('#question'+qID+' table.question thead th').filter(function() {
return $(this).text() == originalText;
})
.text(newText);
});
The code of the first (of 7) answer options I want to be selected by default is 1 (the others are 2-7). The codes of the eight subquestions are also 1-8.
Thank you in advance!
PS: Martin: I have high hopes of Limesurvey 2 - I'm already very impressed by 1.9, but I have a feeling 2 is going to contain some pretty radical improvements. No idea why I have that feeling, but I do