Check out the LimeSurvey source code on GitHub!

How bypass php zip import to add resources ?

More
4 years 2 months ago #90019 by tpartner
Yes, and you should be able to put but selectors in the same call:
$('#answer33913X5X38, #answer33913X5X44').timepicker({

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: Ben_V

Please Log in to join the conversation.

More
4 years 2 months ago #90026 by hug
Everthing is working !!!!!!!!!! :woohoo:

Yeeeha ! Thank you very very much for your precious help and sorry for my bad understanding of javascript :dry:

At least you made someone happy !
The following user(s) said Thank You: Ben_V

Please Log in to join the conversation.

More
4 years 2 months ago #90068 by hug
Assuming I'm totally stupid with javascript. I tried to remove readonly attribute remplacing this
$(".text-short:eq(0) input.text").attr('readonly', 'readonly');

by this
$(".text-short:eq(0) input.text").removeattr('readonly');

On the first question and it has worked, but the following questions failed... So I tried the same as you suggest in your previous replies

For the second question :
$('#answer33913X4X34').removeattr('readonly');

That did not work... What do I have to do, please ?

Please Log in to join the conversation.

More
4 years 2 months ago #90069 by tpartner
This will remove the attribute from all text inputs on the page:
$(".text-short input.text").removeAttr('readonly');

(note: removeAttr should have a capital A)

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: hug

Please Log in to join the conversation.

More
4 years 2 months ago #90072 by hug
Ok. I won't forget the case sensitive information in the future and i understand that when i remove the :eq0 it applies to the whole survey. Thanks.

What I don't understand is :
1. Why if i use my own code without capital A, timepicker behavior changes but nothing change if i totally remove the original line
2. If i use your code that does not change timepicker behavior
3. Why I can directly edit time in all timepicker question except in the first one

What I understand is that i don't understand JS

Please Log in to join the conversation.

More
4 years 2 months ago #90078 by tpartner

when i remove the :eq0 it applies to the whole survey.

Not the whole survey, only all text inputs on the current page.

Can you activate another sample survey?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
4 years 2 months ago #90087 by hug
You will find the activated survey here : cdlvg.free.fr/index.php?sid=33913&lang=fr

You just have to choose anyone of the answer in the radio list and time questions will appear.

Please Log in to join the conversation.

More
4 years 2 months ago #90088 by Ben_V
Hi,
It doesn't works if you just remove (or wrap as comment) this kind of code ?:

$('#answer33913X4X34').attr('readonly', 'readonly');


BenoƮt

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The following user(s) said Thank You: hug

Please Log in to join the conversation.

More
4 years 2 months ago #90092 by tpartner
Yes, in the first question (ID 38), you have this which removes the attribute from all text inputs:
$(".text-short input.text").removeAttr('readonly');

But then in the second question (ID 44), you have this which overrides that and applies the attribute to the first question again:
$(".text-short:eq(0) input.text").attr('readonly', 'readonly');

The JavaScript will be fired sequentially as the page is rendered so any commands or functions will override previous ones.

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: hug

Please Log in to join the conversation.

More
4 years 2 months ago #90152 by hug
Ok ! It works perfectly now :D

I understand my mistake : i thought I could have set this parameter question by question.

One more time, but the last one for this question type, thank you very much you too for your help :)

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form