Hi, Naresh
I have successfully hidden the question and the text section by using the code:
var element =document.getElementById('id_2ff6114df680d13de10000000a781c65');element.parentNode.style.display="none";
Now I still have to tie a script that would be performed in answering the question. For example, I have a the question q1(id_b748794d673ed77de10000000a781c65) and the answer a1 (id_0050568601f81ed598ea87be3f400ab9) as ListAnswerCheckbox. The answer may take 2 values: val1(id_3f6f794d673ed77de10000000a781c65) and val2(id_0050568601f81ed598eabcde1c180ad0).
I want to bind a functions to the values of the answer that will show the next question from the questionnaire. I don't know how to do it.
I tried the following code, but it did not work:
ls_javascript-name = 'answerDSP'. "#EC NOTEXT
ls_javascript-language = 'JavaScript1.2'. "#EC NOTEXT
ls_javascript-script = 'function answerDSP() { '. "#EC NOTEXT
concatenate ls_javascript-script
'var element = document.getElementById(''id_2ff6114df680d13de10000000a781c65'');'
* 'element.style.visibility="hidden";'
* 'var parent = element.parentNode.id;'
'element.parentNode.style.display="none";'
'}'
into ls_javascript-script.
append ls_javascript to lt_javascript.
call method ir_survey_values->javascript_add
exporting
it_script = lt_javascript.
ls_svy_on_event-question_id = Q1. "#EC NOTEXT
ls_svy_on_event-answer_id = A1. "#EC NOTEXT
ls_svy_on_event-name = VAL1. "#EC NOTEXT
concatenate 'answerDSP' '()' into ls_svy_on_event-call_function. "#EC NOTEXT
append ls_svy_on_event to lt_svy_on_event.
call method ir_survey_values->on_event_add
exporting
it_on_event = lt_svy_on_event.
This possible to do? How to associate a function with the value of the answer?