Hello,
How can i set a textarea element in a repeat group to readonly only if not empty? I tried this code but i can't make it work, the textarea remain editable:
i also tried this code, same result as above:
Thank you
How can i set a textarea element in a repeat group to readonly only if not empty? I tried this code but i can't make it work, the textarea remain editable:
Code:
var element = $('group675').getElements('textarea[id^=aplicatii_cm_tickets_675_repeat___solicitare]');
if (element !=='') {
$('aplicatii_cm_tickets_675_repeat___solicitare').setAttribute('readOnly', 'readOnly');
$('aplicatii_cm_tickets_675_repeat___solicitare').addClass('readonly');
}
i also tried this code, same result as above:
Code:
var i = this.getRepeatNum();
var element = document.id('aplicatii_cm_tickets_675_repeat___solicitare_'+i).value;
if (element !=='') {
$('aplicatii_cm_tickets_675_repeat___solicitare').setAttribute('readOnly', 'readOnly');
$('aplicatii_cm_tickets_675_repeat___solicitare').addClass('readonly');
}
Thank you