Welcome, Guest
Username: Password: Remember me

TOPIC: Hiding items

Hiding items 3 years 3 days ago #63854

  • cpippsych
  • cpippsych's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Hey

not sure if this is the place to ask.

looking to find out of lime survey can do this:-

1) hide an entire radio or drop down list button question using jquery
2) hide an entire short text question using jquery
3) hide any entire question using jquery (i could recycle the above if anybody has link to relevant names of questions).

Iif any body help I would appreciate.

From with thanks, Phillip
The administrator has disabled public write access.

Re: Hiding items 3 years 2 days ago #63859

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6207
  • Thank you received: 788
  • Karma: 238
Hello,

To hide question 42 with jquery
<script>
jQuery(document).ready(
$("#question42").hide();
);
</script>

And to hide only the answer part but show the question part. If you use default template.
<script>
jQuery(document).ready(
$("#question42 .answer").hide();
);
</script>

You can use css to, in template.css:
#question42{position:absolute;top:-999em;left:-9999em}
I prefer to use position absolute, sometimes with display:none, you can't manipulate the answers with javascript.

Denis
The administrator has disabled public write access.

Re: Hiding items 3 years 2 days ago #63861

  • cpippsych
  • cpippsych's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
danke muchly!! i also look for a tiny piece code to determine whether a question is hidden or shown? (for us in 'if' statement).

Is that possible?

Phillip
The administrator has disabled public write access.

Re: Hiding items 3 years 2 days ago #63862

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6207
  • Thank you received: 788
  • Karma: 238
I don't understand ?
If a question exist in the page ?
Or if it's hidden by javascript or css ?
Hidden by condition ?

Can you explain your problem exactly : what did you want to do ?

Look at : api.jquery.com/hidden-selector/
Last Edit: 3 years 2 days ago by DenisChenu.
The administrator has disabled public write access.

Re: Hiding items 3 years 2 days ago #63864

  • cpippsych
  • cpippsych's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
Apologies, sorry if my intent was not evident. Apologies, again, my fault.

I was looking for java(J)script rather than CSS. I have managed CSS already to hide something.

I am looking for an on.click event to hide a certain (question&answer). As such, the question would already exist on the page, the question would not be affected by CSS, and there would be no rules/condition. It would merely be by javascript in an ondemand way with relation to a click.

Don't worry if you cannot help. You have already been very helpful, and I would not wish you to expend your effort on my minor question!

Phillip
The administrator has disabled public write access.

Re: Hiding items 3 years 18 hours ago #63873

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6207
  • Thank you received: 788
  • Karma: 238
What you can do,

For example, you put in the source code of a question a img block and assign it the onclick:
<img id="activateonclick" src="mypicture.png" />
<script>
jQuery(document).ready(
$('#activateonclick').click(function() {
  $('#question42').toggle();
});
);
</script>

api.jquery.com/toggle/

:)
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.138 seconds
Donation Image