- Posts: 17
- Thank you received: 0
Multiple short text with different suffix
- ProjetLions
-
Topic Author
- Offline
- New Member
-
Less
More
1 year 8 months ago #205686
by ProjetLions
Multiple short text with different suffix was created by ProjetLions
Hello! I want to create a multiple short text answer with different suffix for each "text". I want the question to look like this :
What is your dog's weight?
_______pound ________ounces
If it's not possible to create a question like the first example, the question could also look like this :
What is your dog's weight?
______pound
______ounces
Thanks in advance!
What is your dog's weight?
_______pound ________ounces
If it's not possible to create a question like the first example, the question could also look like this :
What is your dog's weight?
______pound
______ounces
Thanks in advance!
Please Log in to join the conversation.
1 year 8 months ago - 1 year 8 months ago #205695
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Multiple short text with different suffix
Add this script to the question source:
Sample survey attached:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Change the second suffix
$('#question{QID} .suffix-text:eq(1)').text('ounces');
});
</script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last edit: 1 year 8 months ago by tpartner.
Please Log in to join the conversation.
- ProjetLions
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 17
- Thank you received: 0
1 year 8 months ago #205696
by ProjetLions
Replied by ProjetLions on topic Multiple short text with different suffix
Thank you so much!!
Please Log in to join the conversation.
- lime_novice
-
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 0
10 months 3 weeks ago #217958
by lime_novice
Replied by lime_novice on topic Multiple short text with different suffix
Hello,
I have been looking for a similar solution. What do I need to change in the script if I want to have three different suffixes?
Thanks a lot in advance!
I have been looking for a similar solution. What do I need to change in the script if I want to have three different suffixes?
Thanks a lot in advance!
Please Log in to join the conversation.
10 months 2 weeks ago #218004
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Multiple short text with different suffix
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Change the first suffix
$('#question{QID} .suffix-text:eq(0)').text('years');
// Change the second suffix
$('#question{QID} .suffix-text:eq(1)').text('days');
// Change the third suffix
$('#question{QID} .suffix-text:eq(2)').text('hours');
});
</script>
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.
- Surveylab_KN
-
- Offline
- New Member
-
Less
More
- Posts: 13
- Thank you received: 0
6 months 1 week ago #222033
by Surveylab_KN
Replied by Surveylab_KN on topic Multiple short text with different suffix
Hello,
thanks for this solution! I am very happy to find a lot of helpful solutions in the forum.
Is it possible to use bold font for a part of the text which is manipulated in javascript? I need to add different suffixes, but some parts of it should be bold. I tried to implement HTML-code, but it doesn't work. The HTML-code is shown as text. Unfortunaltely, my javascript knowldege is rather elimentary.
Thanks in advance!
thanks for this solution! I am very happy to find a lot of helpful solutions in the forum.
Is it possible to use bold font for a part of the text which is manipulated in javascript? I need to add different suffixes, but some parts of it should be bold. I tried to implement HTML-code, but it doesn't work. The HTML-code is shown as text. Unfortunaltely, my javascript knowldege is rather elimentary.
Thanks in advance!
Please Log in to join the conversation.
6 months 1 week ago #222035
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Multiple short text with different suffix
You can insert HTML like this:
<script type="text/javascript" data-author="Tony Partner">
$(document).on('ready pjax:scriptcomplete',function(){
// Change the first suffix
$('#question{QID} .suffix-text:eq(0)').html('<strong>Y</strong>ears');
// Change the second suffix
$('#question{QID} .suffix-text:eq(1)').html('<strong>D</strong>ays');
// Change the third suffix
$('#question{QID} .suffix-text:eq(2)').html('<strong>H</strong>ours');
});
</script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Please Log in to join the conversation.
- Surveylab_KN
-
- Offline
- New Member
-
Less
More
- Posts: 13
- Thank you received: 0
6 months 1 week ago #222036
by Surveylab_KN
Replied by Surveylab_KN on topic Multiple short text with different suffix
Thanks a lot for your fast answer!
Please Log in to join the conversation.