- Posts: 10
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Infotext within a free-text-field
- Ursusprimus
- Topic Author
- Offline
- New Member
Less
More
4 years 9 months ago #186834
by Ursusprimus
Infotext within a free-text-field was created by Ursusprimus
Hi,
I'd like some infotext shown inside a free-text-field, which should disappear when entering text. See attachment. Any ideas how to do it?
I'd like some infotext shown inside a free-text-field, which should disappear when entering text. See attachment. Any ideas how to do it?
Attachments:
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
4 years 9 months ago - 4 years 9 months ago #186839
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 Infotext within a free-text-field
That is known as a placeholder.
Try something like this in the question source:
Try something like this in the question source:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ $('#question{QID} input:text').attr('placeholder', 'My placeholder text...'); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 9 months ago by tpartner.
The following user(s) said Thank You: Ursusprimus
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3970
4 years 9 months ago #186840
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Infotext within a free-text-field
Hi,
I think you have to remove the linefeed from
$(document).on('ready
pjax:scriptcomplete',function(){...
to
$(document).on('ready pjax:scriptcomplete',function(){...
Joffm
I think you have to remove the linefeed from
$(document).on('ready
pjax:scriptcomplete',function(){...
to
$(document).on('ready pjax:scriptcomplete',function(){...
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
4 years 9 months ago #186841
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 Infotext within a free-text-field
Thanks, that's what I get for responding via phone.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Ursusprimus
The topic has been locked.
- Ursusprimus
- Topic Author
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 0
4 years 9 months ago #186844
by Ursusprimus
Replied by Ursusprimus on topic Infotext within a free-text-field
it's working fine, thank you!
The topic has been locked.