Usability: Limited chars-length for 'Herkunft der Kenntnisse' / Added chars counter

Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
Cris
2021-04-07 17:17:53 +02:00
committed by cris-technikum
parent 587796e374
commit 094b502862
3 changed files with 39 additions and 3 deletions
@@ -1,4 +1,6 @@
<?php
const HERKUNFT_DER_KENNTNISSE_MAX_LENGTH = 125;
$this->load->view(
'templates/FHC-Header',
array(
@@ -20,7 +22,8 @@ $this->load->view(
'hilfeZuDieserSeite',
'hochladen',
'inBearbeitung',
'neu'
'neu',
'maxZeichen'
),
'person' => array(
'student',
@@ -199,8 +202,9 @@ $this->load->view(
</span>
</div>
<div class="panel-body">
<textarea class="form-control" name="anmerkung" rows="2"
required><?php echo $anrechnungData->anmerkung; ?></textarea>
<textarea class="form-control" name="anmerkung" rows="2" id="requestAnrechnung-herkunftDerKenntnisse"
maxlength="<?php echo HERKUNFT_DER_KENNTNISSE_MAX_LENGTH ?>" required><?php echo $anrechnungData->anmerkung; ?></textarea>
<small><span class="text-muted pull-right">Max. Zeichen: <span id="requestAnrechnung-herkunftDerKenntnisse-charCounter"><?php echo HERKUNFT_DER_KENNTNISSE_MAX_LENGTH ?></span></span></small>
</div>
</div>
</div>
@@ -1,5 +1,6 @@
const ANRECHNUNGSTATUS_APPROVED = 'approved';
const ANRECHNUNGSTATUS_REJECTED = 'rejected';
const HERKUNFT_DER_KENNTNISSE_MAX_LENGTH = 125;
$(function(){
// Set status alert color
@@ -11,6 +12,9 @@ $(function(){
// Init tooltips
requestAnrechnung.initTooltips();
// Set chars counter for textarea 'Herkunft der Kenntnisse'
requestAnrechnung.setCharsCounter();
$('#requestAnrechnung-apply-anrechnung').click(function(e){
// Avoid form redirecting automatically
@@ -85,6 +89,14 @@ var requestAnrechnung = {
}
);
},
setCharsCounter: function(){
$('#requestAnrechnung-herkunftDerKenntnisse').keyup(function() {
let length = HERKUNFT_DER_KENNTNISSE_MAX_LENGTH - $(this).val().length;
$('#requestAnrechnung-herkunftDerKenntnisse-charCounter').text(length);
});
},
formatAnrechnungIsApplied: function (antragdatum, dms_id, filename){
$('#requestAnrechnung-antragdatum').text(antragdatum);
$('#requestAnrechnung-status_kurzbz').text(FHC_PhrasesLib.t("ui", "inBearbeitung"));
+20
View File
@@ -10630,6 +10630,26 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'maxZeichen',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => "Max. Zeichen",
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => "Max. Characters",
'description' => '',
'insertvon' => 'system'
)
)
),
);