Infotext within a free-text-field

More
10 months 2 weeks ago #186834 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?
Attachments:

Please Log in to join the conversation.

LimeSurvey Partners
More
10 months 2 weeks ago - 10 months 2 weeks ago #186839 by tpartner
That is known as a placeholder.

Try something like this in the question source:

<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.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 10 months 2 weeks ago by tpartner.
The following user(s) said Thank You: Ursusprimus

Please Log in to join the conversation.

More
10 months 2 weeks ago #186840 by Joffm
Hi,
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

Please Log in to join the conversation.

More
10 months 2 weeks ago #186841 by tpartner
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.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: Ursusprimus

Please Log in to join the conversation.

More
10 months 2 weeks ago #186844 by Ursusprimus
it's working fine, thank you!

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now