Hide text box in a multi-text sub-question

More
1 week 3 days ago #210277 by Eliott13
Hi. I'm new in the forum. I hope you can bear with me I am working with a survey where I show images in a question of "several short texts" So the person who answers the interview gives a brief description of the images he sees. the problem is that the same images are shown several times in several questions, but in each question a random image will be hidden. so I would like that image that is hidden to respect the position, that is, if image 2 is hidden, that place is respected and it remains blank. Obviously if I put an empty sub-question, it will show me the description box. What I would like to know if there is any way to hide this text box so that it only appends a blank image and the position is respected. I hope I was very clear in my comments. A big hug to all. Elliot

Please Log in to join the conversation.

LimeSurvey Partners
More
1 week 2 days ago #210301 by tpartner
How are you randomly hiding the images?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in to join the conversation.

More
1 week 2 days ago #210359 by Eliott13
Hello,

thanks for reading me,

Images are already hidden by default.

I mean that in each question it is already specified which image to hide.

That is:

P1. remove image 2
P2. remove image 4
P3. remove image 1
P4. remove image 5
P5. remove image 3

I don't do anything, I only remove the image according to the question, but I want this space to be respected so that the interviewee becomes familiar with the position of the images.

Thank you. :)

Please Log in to join the conversation.

More
1 week 2 days ago #210364 by holch
So you manually have the images removed? Why not including a white "image" where you removed this image?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

More
1 week 2 days ago - 1 week 2 days ago #210367 by tpartner
Maybe, as Holch suggests, insert a blank image with a specific class. Then you could use JavaScript to detect those images and hide the corresponding text input.

What LimeSurvey version are you using?

Can you attach a small sample survey (.lss file) containing only one question?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 1 week 2 days ago by tpartner.

Please Log in to join the conversation.

More
1 week 1 day ago #210430 by Eliott13
Thank you very much to both.

It is exactly what I am looking for.

Well, as I mentioned before, I put a blank image where I do not want the image to be shown so that I respect the position.

As Tony mentions, maybe with Java I can achieve this.

I don't really know anything about Java, and that frustrates me a bit.

I am enclosing the lss survey so you can see a bit of what I am building.

A hug to you both.

Eliott
Attachments:

Please Log in to join the conversation.

More
1 week 1 day ago #210432 by tpartner
Assign a class "blank-spacer" to the image and place this script in the question source:
<script type="text/javascript" charset="utf-8">	
	$(document).on('ready pjax:scriptcomplete',function(){
 
		$('#question{QID} .blank-spacer').closest('li')
			.find('input.form-control')
				.prop('disabled', true)
				.css({
					'opacity': 0,
					cursor: 'default'
				});
    });
</script>

Sample survey attached:

File Attachment:

File Name: f2bcc77063...59295c47
File Size:34 KB

 

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Attachments:

Please Log in to join the conversation.

More
1 week 1 day ago #210433 by Eliott13
Hi, Tony,

I offer you a huge apology.

I think I forgot for a moment to mention to you that the version I use is 2.50x

I don't know if the script doesn't work for this version as I did the steps but it doesn't execute correctly.

Regards.

Eliott

Please Log in to join the conversation.

More
5 days 9 hours ago #210495 by Fran1991
Yes it must be something with the version.

I tried it on the 3x and it worked fine, hide the text box as you mention.

Maybe Tony has a script for your version :)

Cheers

Please Log in to join the conversation.

More
4 days 21 hours ago #210500 by tpartner
For 2.73.0:

<script type="text/javascript" charset="utf-8">    
    $(document).on('ready pjax:scriptcomplete',function(){
 
        $('#question{QID} .blank-spacer').closest('.answer-item')
            .find('input.form-control')
                .prop('disabled', true)
                .css({
                    'opacity': 0,
                    cursor: 'default'
                });
    });
</script>

Sample survey attached:For 2.73.0:

File Attachment:

File Name: f15713cc09...d640a0c9
File Size:33 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Attachments:

Please Log in to join the conversation.

More
3 days 16 hours ago #210604 by RUB706
Hi, Tony,

You really are a master for us who do not know anything about Java.

I want to return to the subject, since I am faced with a dilemma similar to Eliott's, but in this case I want to do it with a multiple type question.

It really is the same as Elliot did but with a multiple choice question.

Is there anything that can work?

I really appreciate the help.

Please Log in to join the conversation.

More
3 days 15 hours ago #210608 by tpartner
What LimeSurvey version are you using?

Can you attach a small sample survey (.lss file) containing only one question?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in to join the conversation.

More
3 days 12 hours ago #210617 by RUB706
Hi, Tony,

Thanks for your help.

Right now I can't attach the survey, since I don't have access.

But I'll tell you that I use two versions, the 3x and the 2.73.

But right now I'm testing 2.73, which is the one with which the theme is currently

I really appreciate your great effort. ;) :)

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now