- Posts: 22
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Dollar sign prefix appears above input box
- LeftyMaus
- Topic Author
- Offline
- Junior Member
Less
More
6 years 3 months ago #162039
by LeftyMaus
Dollar sign prefix appears above input box was created by LeftyMaus
Hi,
I would like to bring an older survey into the new default template, but the Numeric question does not display properly. Instead of...
$ [numinputbox]
...the survey displays:
$
[numinputbox]
I tried to correct the behavior by manually adding
to the end of template.css, but that does not seem to help.
I thought it was related to my old survey, but it also happens when I create a brand new survey and using the default settings. To recreate the problem, open Limesurvey (I am running Limesurvey v2.72.6).
See attached image, *.lss file, and default template. The problem shows in Chrome and Firefox.
For what its worth, the older version that I am migrating from is v2.56.1.
I would like to bring an older survey into the new default template, but the Numeric question does not display properly. Instead of...
$ [numinputbox]
...the survey displays:
$
[numinputbox]
I tried to correct the behavior by manually adding
Code:
.numeric {display: inline;}
I thought it was related to my old survey, but it also happens when I create a brand new survey and using the default settings. To recreate the problem, open Limesurvey (I am running Limesurvey v2.72.6).
- Click "Create a new survey"
- enable the "Sample question:" setting in order to add a group and sample question to the new survey
- Ensure that the Template is set to "Default"
- Click "save and close"
- Edit the default question
- Change question type to Numerical Input
- Click "Advanced settings"
- enter $ into the field "Answer prefix (en): "
- Again click "save and close"
- Then preview the question
See attached image, *.lss file, and default template. The problem shows in Chrome and Firefox.
For what its worth, the older version that I am migrating from is v2.56.1.
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10635
- Thank you received: 3699
6 years 3 months ago #162056
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 Dollar sign prefix appears above input box
This appears to be a bug, please report it -
www.limesurvey.org/community/bug-tracker
.
In the meantime, give the question a CSS class "with-prefix" and add something like this to the end of template.css:
In the meantime, give the question a CSS class "with-prefix" and add something like this to the end of template.css:
Code:
.numeric.with-prefix input.text { display: inline-block; width: auto; }
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- LeftyMaus
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 1
6 years 3 months ago #162061
by LeftyMaus
Replied by LeftyMaus on topic Dollar sign prefix appears above input box
I don't know how to give a particular question a CSS class, but I was able to identify a CSS handle. By looking over the source code of the survey preview, I identified all <p> of the class "withprefix" that are contained within <div> of the class "answer". In other words:
Rather than constantly fiddling with the template.css file, I implemented the css formatting change using java at runtime. By injecting this code directly into the "Question:" field of question code Q00, this helped me visualize what was going wrong by highlight the problem in red.
Using this method, I adopted your suggestion, but removed ".with-prefix" from the phrase '.numeric.with-prefix input.text'. It seems to have fixed the problem. But I'll have to spend a bit more time troubleshooting, so that I'm confident I haven't caused other trouble by making the handle too broad.
I've refreshed the screenshot to show the highliting while in effect.
Code:
div.answer p.withprefix
Rather than constantly fiddling with the template.css file, I implemented the css formatting change using java at runtime. By injecting this code directly into the "Question:" field of question code Q00, this helped me visualize what was going wrong by highlight the problem in red.
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // highlight the problem in red $( 'div.answer p.withprefix' ).css({ 'color': 'red', 'background-color': 'rgba(255,0,0,0.3)' }); }); </script>
Using this method, I adopted your suggestion, but removed ".with-prefix" from the phrase '.numeric.with-prefix input.text'. It seems to have fixed the problem. But I'll have to spend a bit more time troubleshooting, so that I'm confident I haven't caused other trouble by making the handle too broad.
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // suggested fix by tpartner // dropped ".with-prefix" from the phrase '.numeric.with-prefix input.text' $( '.numeric input.text' ).css({ 'display': 'inline-block', 'width': 'auto' }); }); </script>
I've refreshed the screenshot to show the highliting while in effect.
Attachments:
The topic has been locked.
- LeftyMaus
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 22
- Thank you received: 1
6 years 3 months ago #162062
by LeftyMaus
Replied by LeftyMaus on topic Dollar sign prefix appears above input box
I'm happy to submit a bug, but it won't allow me to log in. Instead I get the disabled/blocked/incorrect error. Its obvious that I'm able to log in to the forum, but the bug tracking system doesn't seem to recognize the same login credentials.
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10635
- Thank you received: 3699
6 years 3 months ago #162069
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 Dollar sign prefix appears above input box
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: LeftyMaus
The topic has been locked.