Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Array text Submit button clear checkboxes

  • jeremt
  • jeremt's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 4 months ago #177581 by jeremt
Hi,

After several hours of research and testing, I decided to post my first message on this forum. New users and not programmer I use a 2.6 version Version 2.67.3+170728 and Version 2.73.1+171220.

I am trying to create a question where people can choose a value on an exclusive check box and alternative rank on a droplist. I followed different posts realized the work with the "option" side by side then edit the question with text array where I used checkboxes and a droplist.
It works !!! Thanks to the different pieces of code provided by other users and the solutions provided by Tpartner. But now my problem is that during the submission if the EM equation fail the checkboxes are cleaned. (not the values ​​in the text input). The problem happens on many of my questions. For solves this, I research in two directions. First, how to re-activate the checkboxes if the input text is available or to display the submit button if the conditions are valid. But I think it’s not the good option. And The second is to make the submission button appear if the conditions are valid. For that I tried to adapt the answer provided here (for input.radio I know):

www.limesurvey.org/de/foren/can-i-do-thi...or-a-yes-no-question

and here :
www.limesurvey.org/forum/can-i-do-this-w...on-question?start=30

With age question but impossible to have the right behavior.
I don’t understand what clear the checkbox or how write the condition for the submit button ? Maybe there are a better approach ? The files attached show the behavior
If anyone can help me
Thanks
The topic has been locked.
  • jeremt
  • jeremt's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 3 months ago #178778 by jeremt
Replied by jeremt on topic Array text Submit button clear checkboxes
A solution adding to the source of question , after the return on select:
Code:
$('input:text', thisQuestion).each(function(i) {
      var thisCell = $(this).closest('.answer-item');
      var inputText = $.trim($(this).val());
      if($.trim($(this).val()) != '') {
        $('input.checkbox', thisCell).each(function(i) {
          $(this).prop('checked', true);
          });
        }
    });
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose