- Posts: 65
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Force all caps
- jimdavies
- Topic Author
- Offline
- Senior Member
Less
More
5 years 4 weeks ago #182326
by jimdavies
Force all caps was created by jimdavies
Is it possible to create a short answer question that forces the user to use all caps?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
5 years 3 weeks ago #182338
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 Force all caps
LimeSurvey version?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- jimdavies
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 65
- Thank you received: 0
5 years 3 weeks ago #182373
by jimdavies
Replied by jimdavies on topic Force all caps
Version 2.58.0+170104
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10103
- Thank you received: 3591
5 years 3 weeks ago #182375
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 Force all caps
Place this script in the question source to force all uppercase in the text input:
Sample survey attached:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); // Listener on the text input $('input:text', thisQuestion).on('keyup', function(e) { $(this).val($(this).val().toUpperCase()); checkconditions($(this).attr('value'), $(this).attr('name'), $(this).attr('type')); }); }); </script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- jimdavies
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 65
- Thank you received: 0
5 years 3 weeks ago #182376
by jimdavies
Replied by jimdavies on topic Force all caps
Thanks, the addition to the question source worked
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Identify this question
var thisQuestion = $('#question{QID}');
// Listener on the text input
$('input:text', thisQuestion).on('keyup', function(e) {
$(this).val($(this).val().toUpperCase());
checkconditions($(this).attr('value'), $(this).attr('name'), $(this).attr('type'))
});
});
</script>
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
// Identify this question
var thisQuestion = $('#question{QID}');
// Listener on the text input
$('input:text', thisQuestion).on('keyup', function(e) {
$(this).val($(this).val().toUpperCase());
checkconditions($(this).attr('value'), $(this).attr('name'), $(this).attr('type'))
});
});
</script>
The topic has been locked.