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

More
10 months 1 week ago - 10 months 1 week 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: 10 months 1 week ago by nhotovas.

Please Log in or Create an account to join the conversation.

More
10 months 1 week 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 or Create an account to join the conversation.

More
10 months 1 week 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 or Create an account to join the conversation.

More
10 months 1 week ago - 10 months 1 week 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: 10 months 1 week ago by tpartner.

Please Log in or Create an account to join the conversation.

More
10 months 1 week 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 or Create an account to join the conversation.

More
6 months 1 week ago #161704 by nhotovas
nhotovas replied the topic: List (ratio) with prefix and sufix for numerical input?
Dear Tony,

In my company have plans to upgrate lime version (probably on 2.7X). So i imported my survey from 2.05 on trial version of lime , just to see how it will works, but unfortunately this code what you recomended doesn't work. It worked perfectly in lime 2.05. Do you have any idea why it shouldn't work on new lime versions? I worry if I don't find solution, becouse users used to have it in this form.
Now it looks like:



Thank you in advance...
Attachments:

Please Log in or Create an account to join the conversation.

More
6 months 1 week ago #161710 by jelo
jelo replied the topic: List (ratio) with prefix and sufix for numerical input?

nhotovas wrote: Do you have any idea why it shouldn't work on new lime versions?

LimeSurvey 2.7X is using a complete different template system. So nearly all workarounds which depended on HTML modification via Javascript need an update. With LS 3.0 the whole templatesystem changes again. So you might wait till LS 3.0 is hitting the street and then start the migration tests.

Please Log in or Create an account to join the conversation.

More
6 months 1 week ago #161727 by holch
holch replied the topic: List (ratio) with prefix and sufix for numerical input?
I agree with Jelo. If you you are thinking about upgrading now at this point in time, I would wait a little longer until a stable 3.0 is out (was promissed for this year, but I am not sure how realistic this still is). However, we already have Release Candicate 3, so I guess it can only take a few weeks until a stable release will be published. Hopefully this was not such a quick shot and the template system will stay stable for quite some time (but I think it will, because Denis took care of it and I think he is more the "stable" kind of guy anyway). Then it will also be worth to develop own templates and for Tpartner to develop his workarounds.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
6 months 1 week ago #161732 by tpartner
tpartner replied the topic: List (ratio) with prefix and sufix for numerical input?
Yes, I would also wait for 3.x before updating - many many improvements.

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

Please Log in or Create an account to join the conversation.

More
6 months 1 week ago #161747 by nhotovas
nhotovas replied the topic: List (ratio) with prefix and sufix for numerical input?
Hi all...

thank you for your advices, but the company will gradually upgrade to the 3.0 and for the current needs the upgrade to 2.72.6 will be done now. The other surveys do not have same problem like I am facing with this upgrade, so I must search for some way out and solution for my problem.
Any idea?

Please Log in or Create an account to join the conversation.

More
6 months 1 week ago - 6 months 1 week ago #161748 by holch
holch replied the topic: List (ratio) with prefix and sufix for numerical input?
"but the company will gradually upgrade to the 3.0 and for the current needs the upgrade to 2.72.6 will be done now."
Makes totally sense. Waiting 3 years with upgrades, then, when 2.7x is getting to end of life and 3.0 is about to come out make a quick upgrade to 2.7x.

I assume the next update and upgrade to 3.x is planned in about 2 years, when 4.0 is coming out? ;-)

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Last Edit: 6 months 1 week ago by holch.

Please Log in or Create an account to join the conversation.

More
6 months 1 week ago #161752 by tpartner
tpartner replied the topic: List (ratio) with prefix and sufix for numerical input?
This will work for 2.72.5...

1) HTML for the Other label:

About <span class="post-text"> customers order online.</span>

2) JavaScript:

<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		$('#question{QID} input[type="text"]').parent().after('<div class="pull-left post-text-wrapper" style="padding:5px 0 0 5px;" />');
		$('#question{QID} .post-text-wrapper').append($('#question{QID} span.post-text'));
	});
</script>

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

Please Log in or Create an account to join the conversation.

More
6 months 1 week ago #161783 by nhotovas
nhotovas replied the topic: List (ratio) with prefix and sufix for numerical input?
Actually, my favorite number is 5, maybe I can wait 5.0 :laugh:

I am not the one who decide in my company, but as I told you, I am informed that they have plans to upgrade it step by step, I suppose they have reasons for what they do that.
However, the fact is that my company have chosen LimeSurvey and not some other survey tool...and upgrade ...better late than never ;)

Please Log in or Create an account to join the conversation.

More
6 months 1 week ago #161784 by nhotovas
nhotovas replied the topic: List (ratio) with prefix and sufix for numerical input?
Dear Tony...thank you very very much...you help as always...
I had double text after input box, so i deleted it from "Other" label and I added one more append on JavaScript...now its everything ok...

Best Regards!

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!