"ls-question-text-{$oEvent->get('surveyId')}X{$oEvent->get('gid')}X{$oEvent->get('qid')}" : where did you find this id ? I don't think it exist anywhre.
Here $labels = getElementsByTagName('label');
foreach $labels as label : check
attribute "for"
answerSGQA
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.
- "ls-question-text-{$oEvent->get('surveyId')}X{$oEvent->get('gid')}X{$oEvent->get('qid')}" : where did you find this id ? I don't think it exist anywhre.
I got it from inspecting a "Long Free Text" question, in LS v3 as below.
//type T
<div class=" question-text ">
<div id="ls-question-text-666477X2X24" class=" ls-label-question ">
My Long Free Text
</div>
</div>
I would like to read/change the text "My Long Free Text" in beforeQuestionRender(). It seems toolsDomDocument should be able to do that. But what should I use in place of 'xxxxxxx' below? If you could point me to the documentation of event->get and event->set, I would greatly appreciate it.
$dom = new \toolsDomDocument\SmartDOMDocument();
$dom->loadPartialHTML($this->event->get('xxxxxxx'));
$sLableId="ls-question-text-{$oEvent->get('surveyId')}X{$oEvent->get('gid')}X{$oEvent->get('qid')}";
$input=$dom->getElementById($sLabelId);
And here : it's not label tag.
See event doc :
www.limesurvey.org/manual/BeforeQuestionRender
The event allow you to update
- aQuestion.text ( My Long Free Text)
- aQuestion.answer (<textarea … >)
- ....
maybe best is to exlain what do you want to do ?
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.