- Posts: 10108
- Thank you received: 3593
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
HTML/ JavaScript program for input
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
7 years 1 month ago #149555
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic HTML/ JavaScript program for input
If you want to include the dashes and spaces in your data, simply use a short-text type question instead of a numeric type.
If you want to remove the dashes and spaces in your data, replace both instances of this:
with this:
If you want to replace the dashes and spaces with commas in your data, replace both instances of this:
with this:
If you want to remove the dashes and spaces in your data, replace both instances of this:
Code:
thisInput.val(document.getElementById('Zahlenanzeige').innerHTML);
Code:
thisInput.val(document.getElementById('Zahlenanzeige').innerHTML.replace(/\s+/g, '').replace(/-/g, ''));
If you want to replace the dashes and spaces with commas in your data, replace both instances of this:
Code:
thisInput.val(document.getElementById('Zahlenanzeige').innerHTML);
Code:
thisInput.val(document.getElementById('Zahlenanzeige').innerHTML.replace(/\s+/g, '').replace(/-/g, ','));
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: Spix
The topic has been locked.
- Spix
- Topic Author
- Offline
- New Member
Less
More
- Posts: 16
- Thank you received: 0
7 years 2 weeks ago #152239
by Spix
Replied by Spix on topic HTML/ JavaScript program for input
Hey folks. I'm back with another tiny problem.
I improved my design a bit and have chosen two different musical scales (7 tones) with which my participants are going to work.
So I thought about packing both scales in the srcList and make two questions where one is using cases 1-7 and the other 8-14. The problem is that I cant tell the onkeydown section to activate for button one (keycode 49) the buttonpress event 1 and 8 at the same time.
The solution might be to copy the whole section, modify it for the other scale and tell each one which question is theirs. tpartner did this kind of assignment 5 posts above. So I did this and called all former "Zahlenanzeige" arrays "ZahlenanzeigeMixo" and "ZahlenanzeigeDorisch" but I messed it up.
I attached the question and template before I messed it up. Maybe some of you guys can help me out again. I hope its understandable what I have in mind.
Cheers
I improved my design a bit and have chosen two different musical scales (7 tones) with which my participants are going to work.
So I thought about packing both scales in the srcList and make two questions where one is using cases 1-7 and the other 8-14. The problem is that I cant tell the onkeydown section to activate for button one (keycode 49) the buttonpress event 1 and 8 at the same time.
The solution might be to copy the whole section, modify it for the other scale and tell each one which question is theirs. tpartner did this kind of assignment 5 posts above. So I did this and called all former "Zahlenanzeige" arrays "ZahlenanzeigeMixo" and "ZahlenanzeigeDorisch" but I messed it up.
I attached the question and template before I messed it up. Maybe some of you guys can help me out again. I hope its understandable what I have in mind.
Cheers
Attachments:
The topic has been locked.
- Spix
- Topic Author
- Offline
- New Member
Less
More
- Posts: 16
- Thank you received: 0
7 years 2 weeks ago #152296
by Spix
Replied by Spix on topic HTML/ JavaScript program for input
I tried again and here are my questions and the template. The first one (mixo) works but the second (dorisch) does not want to.
Attachments:
The topic has been locked.
- Spix
- Topic Author
- Offline
- New Member
Less
More
- Posts: 16
- Thank you received: 0
7 years 2 weeks ago #152298
by Spix
Replied by Spix on topic HTML/ JavaScript program for input
Ok for whatever reason it doesn't work in Chrome on my PC but with all other Browsers and Chrome on other devices it works just fine. So I think I can live with that.
Thanks folks
Thanks folks
The topic has been locked.