- Posts: 8
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
protecting DEFAULT answer from being changed at runtime in a survey
- kirti
- Topic Author
- Offline
- New Member
Less
More
8 years 8 months ago #122511
by kirti
protecting DEFAULT answer from being changed at runtime in a survey was created by kirti
Hi
Please let me know how to protect the editing the default answer of the question that is prefilled at runtime ?
I mean when the survey participant looks at the prefilled answer, he /she should not be able to edit it.
Please help
Thanks
Regards
Kirti
Please let me know how to protect the editing the default answer of the question that is prefilled at runtime ?
I mean when the survey participant looks at the prefilled answer, he /she should not be able to edit it.
Please help
Thanks
Regards
Kirti
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
8 years 8 months ago #122522
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 protecting DEFAULT answer from being changed at runtime in a survey
You may want to use an equation type question for that.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- kirti
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
8 years 8 months ago #122524
by kirti
Replied by kirti on topic protecting DEFAULT answer from being changed at runtime in a survey
No Tony, thats not helping. I have to prefill the answer of the question "Name of the person being reviewed" where A is reviewing B so B's name is picked from Token:Attribute and that gets filled as default answer. But when I checked the short text box filled with answer, I could edit and insert another answer, which should NOT happen. That default answer should fade and should not be editable.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13907
- Thank you received: 2546
8 years 8 months ago #122525
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic protecting DEFAULT answer from being changed at runtime in a survey
Hi,
Hide the question, than user don't see the question.
Hide the question, than user don't see the question.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- kirti
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
8 years 8 months ago #122532
by kirti
Replied by kirti on topic protecting DEFAULT answer from being changed at runtime in a survey
question should be seen along with is default answer and requirement is editing of default answer should be prohibited
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13907
- Thank you received: 2546
8 years 8 months ago #122534
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic protecting DEFAULT answer from being changed at runtime in a survey
Then : you don't need default answer, you need "Show something to user"
If you need to register information in the DB : use Equation question type
If you need to show : {TOKEN:ATTRIBUTE_1} in the question text or help.
You can show it "like" a input text:
Denis
If you need to register information in the DB : use Equation question type
If you need to show : {TOKEN:ATTRIBUTE_1} in the question text or help.
You can show it "like" a input text:
Code:
<input type="texte" readonly="readonly" value="{TOKEN:ATTRIBUTE_1}" />
Denis
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- rola
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 0
8 years 7 months ago #123284
by rola
Replied by rola on topic protecting DEFAULT answer from being changed at runtime in a survey
why don't you disable the textbox ...
Code:
<script> $(document).ready(function(){ $('#answer813917X1X68').attr('disabled','true'); $('#answer813917X1X68').val('{TOKEN:ATTRIBUTE_1}'); }); </script>
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
8 years 7 months ago #123286
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 protecting DEFAULT answer from being changed at runtime in a survey
Disabling the input may prevent the data from being recorded. You should use .prop('readonly', true).
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: rola
The topic has been locked.
- fvanderstarre
- Offline
- Elite Member
Less
More
- Posts: 176
- Thank you received: 36
8 years 7 months ago #123302
by fvanderstarre
Replied by fvanderstarre on topic protecting DEFAULT answer from being changed at runtime in a survey
Question type "Text display"?
The topic has been locked.
- rola
- Offline
- New Member
Less
More
- Posts: 10
- Thank you received: 0
8 years 7 months ago #123465
by rola
Replied by rola on topic protecting DEFAULT answer from being changed at runtime in a survey
Thanks tpartner .... disabling the input prevent data from being recorded (i am using v 2.06+).
fvanderstarre above example is for "Short free text" ... it can be applied for any other question type that renders input elements
Code:
<script> $(document).ready(function(){ $('#answer813917X1X68').prop('readonly', true); $('#answer813917X1X68').val('{TOKEN:ATTRIBUTE_1}'); }); </script>
fvanderstarre above example is for "Short free text" ... it can be applied for any other question type that renders input elements
The topic has been locked.
- fvanderstarre
- Offline
- Elite Member
Less
More
- Posts: 176
- Thank you received: 36
8 years 7 months ago #123475
by fvanderstarre
Replied by fvanderstarre on topic protecting DEFAULT answer from being changed at runtime in a survey
What I meant to say was: why not use question type text display? You don't have to worry about protecting from input there.
The topic has been locked.