- Posts: 11
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Save data from hidden question
8 years 11 months ago #107243
by LimeLight
Save data from hidden question was created by LimeLight
Hi,
I'm generating a GUID via a javascript. I'm printing it to a long textfield. However, when i set the question to "always hide this question" the GUID is not stored among the answers. How can I make the GUID stick to the answer table while still being hidden?
// TIA
I'm generating a GUID via a javascript. I'm printing it to a long textfield. However, when i set the question to "always hide this question" the GUID is not stored among the answers. How can I make the GUID stick to the answer table while still being hidden?
// TIA
The topic has been locked.
8 years 11 months ago #107248
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Save data from hidden question
You can't write to a question which is hidden via "always hide this question" because it does no show up in the HTML code and you can only write with Javascript to a question that is in the HTML code.
What you need to do is hide the question via CSS, thus it is just not shown in the browser, but it is still in the html code and thus read and writable via JS.
What you need to do is hide the question via CSS, thus it is just not shown in the browser, but it is still in the html code and thus read and writable via JS.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
8 years 11 months ago #107266
by byan
Replied by byan on topic Save data from hidden question
Alternatively, you can write $("#questionID").hide(); in the question box or help box if you don't want to mess with CSS.
The following user(s) said Thank You: holch
The topic has been locked.
8 years 11 months ago #107268
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic Save data from hidden question
I didn't know this one. That is an interesting alternative, because you don't need to make chances to the template css.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
8 years 11 months ago #107269
by TMSWhite
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
Replied by TMSWhite on topic Save data from hidden question
If the goal is to have the GUID stored in the database, then you can use an Equation question to do this. Equations are unique among questions types in that their value is always saved to the database even if the always_hidden attribute is set. For all other question types, if the question is hidden by always_hidden, or relevance (e.g. the question is not applicable), then the database stores NULL for that question.
If you depend upon LimeSurvey or the support team, please give generously to our 2012 fundraiser .
- Expression Manager (EM):
Documentation
|
Sample Surveys
|
How Tos
|
Show Logic File
|
Upgrading to 1.92+ - Excel Style for Survey Structure Import/Export
The topic has been locked.
- DenisChenu
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 12875
- Thank you received: 2369
8 years 11 months ago #107278
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 Save data from hidden question
Hi,
@Thomas : hidden => save in DB : default value OR value set by Equation ( Q1="Answer ).
No ability to use javascript
@Thomas : hidden => save in DB : default value OR value set by Equation ( Q1="Answer ).
No ability to use javascript

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.