- Posts: 17
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Disabling Title and Comment input fields of File upload dialog
- t420ss
- Topic Author
- Offline
- New Member
Less
More
5 years 9 months ago - 5 years 9 months ago #171043
by t420ss
Disabling Title and Comment input fields of File upload dialog was created by t420ss
One of the questions in my survey is a file upload. I allow only one file, and only file name will suffice, I don't need file Title and file Comment.
So I want to disable file Title and file Comment input text field.
One way:
Ideally, I want to put something like 'n/a' as a place holder in those text fields and disable them, so that users cannot edit.
Ref: 1_UploadDialog.png (input field has not been disabled in the screenshot, I just typed in n/a. )
Q1: Which template (file) renders that input text field?
When I upload file, I can see n/a, n/a in the value fields of Title and Comment.
Ref: 2_SurveyPage.png
Q2: Which template (file) renders the survey page? I want to edit the alignment of the answers (of the file upload).
Seems right aligned. I want to show the values aligned on the left, as shown by red arrow.
Other way:
Removing those unneeded fields is also an option.
I found that by editing survey/application/controllers/UploaderController.php, I can remove the two fields (Title and Comment) entirely, like this:
Ref: 3_UploadDialog_Title_Comment_Removed.png
But the survey page shows 'undefined' 'undefined' in the value field for that question. (understandably).
Ref: 4_SurveyPage_Title_Comment_Undefined.png
... doesn't look nice.
Either way, I want to know which file to edit so that I can display n/a in the value field.
But it may have other consequences, so the 'first way', that is , hard coding 'n/a' in those text fields and disabling them might be a better solution.
Could someone please give me some directions?
Thank you.
So I want to disable file Title and file Comment input text field.
One way:
Ideally, I want to put something like 'n/a' as a place holder in those text fields and disable them, so that users cannot edit.
Ref: 1_UploadDialog.png (input field has not been disabled in the screenshot, I just typed in n/a. )
Q1: Which template (file) renders that input text field?
When I upload file, I can see n/a, n/a in the value fields of Title and Comment.
Ref: 2_SurveyPage.png
Q2: Which template (file) renders the survey page? I want to edit the alignment of the answers (of the file upload).
Seems right aligned. I want to show the values aligned on the left, as shown by red arrow.
Other way:
Removing those unneeded fields is also an option.
I found that by editing survey/application/controllers/UploaderController.php, I can remove the two fields (Title and Comment) entirely, like this:
Code:
<input type="hidden" id="'.$fn.'_show_comment" value="0"/> <input type="hidden" id="'.$fn.'_show_title" value="0"/>
Ref: 3_UploadDialog_Title_Comment_Removed.png
But the survey page shows 'undefined' 'undefined' in the value field for that question. (understandably).
Ref: 4_SurveyPage_Title_Comment_Undefined.png
... doesn't look nice.
Either way, I want to know which file to edit so that I can display n/a in the value field.
But it may have other consequences, so the 'first way', that is , hard coding 'n/a' in those text fields and disabling them might be a better solution.
Could someone please give me some directions?
Thank you.
Last edit: 5 years 9 months ago by t420ss.
The topic has been locked.
- DenisChenu
- Away
- LimeSurvey Community Team
Less
More
- Posts: 13676
- Thank you received: 2496
5 years 9 months ago #171055
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 Disabling Title and Comment input fields of File upload dialog
Why not use advanced settings :
manual.limesurvey.org/Question_type_-_File_upload#File_metadata
If it don't work report the issue
If it don't work report the issue
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.
Attachments:
The topic has been locked.
- t420ss
- Topic Author
- Offline
- New Member
Less
More
- Posts: 17
- Thank you received: 0
5 years 9 months ago - 5 years 9 months ago #171060
by t420ss
Replied by t420ss on topic Disabling Title and Comment input fields of File upload dialog
It was less than 3 second's work. (less than 1.5 seconds for each click)
What a shame I didn't read/check the available options.
Time to move on
Have other issues to worry - like the logo not showing up.
Thank you, D.
What a shame I didn't read/check the available options.
Time to move on
Have other issues to worry - like the logo not showing up.
Thank you, D.
Last edit: 5 years 9 months ago by t420ss.
The topic has been locked.