Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Validation Ignored on "Hidden" Questions?

Validation Ignored on "Hidden" Questions? 3 years 9 months ago #55515

I have a "hidden" question (Always hide this question = YES) that is populated via the end URL from a previous survey. Everything regarding that works fine. However, I have validation on this hidden question that does not seem to be applied - Is this by design?

noticed I've not posted this in the correct forum...apologies.
Last Edit: 3 years 9 months ago by RhythmScout.
The administrator has disabled public write access.

Re: Validation Ignored on "Hidden" Questions? 3 years 9 months ago #55606

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
1. Why do you need the validation if the data for this question is inputted by URL?

2. Does it work fine if the question is not hidden?

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Validation Ignored on "Hidden" Questions? 3 years 9 months ago #55608

Mazi wrote:
1. Why do you need the validation if the data for this question is inputted by URL?
I don't "really" need this second round of validation. As you point out, in theory this answer has already been validated when input on the original question (survey A) and passed via end URL to survey B. My intent with re-validating the hidden field is to prevent population if the user has messed with the URL params.
Mazi wrote:
2. Does it work fine if the question is not hidden?
Yes, validates correctly if the question is not hidden.
This is not a huge deal, as it is unlikely that the users of my survey will intentionally modify the url, but you never know.
Last Edit: 3 years 9 months ago by RhythmScout.
The administrator has disabled public write access.

Re: Validation Ignored on "Hidden" Questions? 3 years 9 months ago #55613

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
I can only guess why the validation doesn't work for hidden questions. Maybe the validating Javascript code has problems dealing with hidden elements!?

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: Validation Ignored on "Hidden" Questions? 3 years 8 months ago #55716

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6451
  • Thank you received: 844
  • Karma: 249
(Always hide this question = YES) offer a possibility to fill some column database, but this question doesn't really exist, it never apear at screen, then it never tested.

You can use something like that in your template.css:
#questionXXX{
  position:absolute;
  left:-999em;
  top:-999em;
}

But there is a problem ith validation, i think the best is to use "condition" for the question.
For condition, it don't work for the question on the same page, but it work for question on next page :).
The administrator has disabled public write access.

Re: Validation Ignored on "Hidden" Questions? 3 years 8 months ago #55887

  • timbee
  • timbee's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 20
  • Thank you received: 1
  • Karma: 1
RhythmScout wrote:
... (Always hide this question = YES) ... validation on this hidden question that does not seem to be applied

Apparently when "Always hide this question" is set to Yes, it will not display the question on the page at all. I *thought* it would still output the question html but just set the input type to hidden.

What I did instead, was use jquery to set the question's css style "display:none", so it's in the HTML but not actually rendered in the browser window.

question text example:
<script type="text/javascript">
$(document).ready(function() {
	$("#answer{SGQ}").val(stamp());
	$("#answer{SGQ}").css('display', 'none');
 });
</script>
The administrator has disabled public write access.

Re: Validation Ignored on "Hidden" Questions? 3 years 8 months ago #55888

  • timbee
  • timbee's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 20
  • Thank you received: 1
  • Karma: 1
Oh, I forgot ... I added the {SGQ} special replacement myself. It seems to be working well and is useful, especially for javascript actions on the current question. maybe there's another way to reference the SurveyID,GroupID,QuestionID in the question text, but I wasn't able to find it. Any limeSurvey developers think it's a good idea to add this into the main code?
The administrator has disabled public write access.

Re: Validation Ignored on "Hidden" Questions? 3 years 8 months ago #55892

timbee wrote:
What I did instead, was use jquery to set the question's css style "display:none", so it's in the HTML but not actually rendered in the browser window.

Thx timbee, I ended up using jquery to hide it. Love how LS uses jquery, makes dom modifications so simple w/o touching the base code.
Last Edit: 3 years 8 months ago by RhythmScout.
The administrator has disabled public write access.

Re: Validation Ignored on "Hidden" Questions? 3 years 8 months ago #55893

  • timbee
  • timbee's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 20
  • Thank you received: 1
  • Karma: 1
How did you reference the question element in jquery?
The administrator has disabled public write access.

Re: Validation Ignored on "Hidden" Questions? 3 years 8 months ago #55894

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5331
  • Thank you received: 296
  • Karma: 249
timbee wrote:
Apparently when "Always hide this question" is set to Yes, it will not display the question on the page at all. I *thought* it would still output the question html but just set the input type to hidden.
In combination with conditions this really is a problem! Please open a ticket at the bugtracker and...

1. Give as much information as possible

2. Attach your survey. You can mark your ticket "private" so that only the developers will be able to take a look at it.

3. Provide step-by-step instructions how to reproduce the problem.

4. If possible/helpful please provide screenshots

Afterwards please post the link to the bugtracker so we can follow the progress.

Thanks!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.180 seconds
Donation Image