List (ratio) with prefix and sufix for numerical input?

More
3 months 3 weeks ago - 3 months 3 weeks ago #157607 by nhotovas
nhotovas created the topic: List (ratio) with prefix and sufix for numerical input?
Hi all,

I have a List(Radio) question, and one of the options/answers should have a possibility for inputting a number. With other words, one option should be i.e. „About [HERE INPUT A NUMBER] costumers order online. “
It should look like this:


I temporary resolved this with the option "other", but the problem is that the number should be between some words and not at the end.
Do you have any ideas how to add suffix on "other“ or any other solution to resolve this?

Thanks for help.
Attachments:
Last Edit: 3 months 3 weeks ago by nhotovas.

Please Log in to join the conversation.

More
3 months 3 weeks ago #157614 by tpartner
tpartner replied the topic: List (ratio) with prefix and sufix for numerical input?
You should be able to move the input via JavaScript.

What LimeSurvey version are you using?

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
3 months 3 weeks ago #157619 by nhotovas
nhotovas replied the topic: List (ratio) with prefix and sufix for numerical input?
Thank you for your response. I assumed it could be solved with JavaScript, and I tried but did not manage... but honestly I am not an expert for JavaScript :(
I would appreciate a lot your help if you had an example for sharing.

I use version 2.05+ Build 141229.
Regards!

Please Log in to join the conversation.

More
3 months 3 weeks ago - 3 months 3 weeks ago #157623 by tpartner
tpartner replied the topic: List (ratio) with prefix and sufix for numerical input?
1) Insert something like this as the "Label for 'Other:' option":

About <span class="value">x</span> customers order online.

2) Add this script to the question source:

<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		$('#question{QID} .other-item span.value').after($('#question{QID} label[for$="othertext"]')).remove();
	});
</script>



Sample survey attached:

File Attachment:

File Name: limesurvey...8-15.lss
File Size:16 KB

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 3 months 3 weeks ago by tpartner.

Please Log in to join the conversation.

More
3 months 3 weeks ago #157627 by nhotovas
nhotovas replied the topic: List (ratio) with prefix and sufix for numerical input?
It works!!! Thank you very much!!!

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!