Hello,
I need to set a textarea element to be readonly after a value has been entered and form was saved. More, the element is added into a repeat group "attached" to the form. How can i do this?
I've added the following code into a XX.js file but this will set every instance of the textarea element to be readonly :
Thank you
I need to set a textarea element to be readonly after a value has been entered and form was saved. More, the element is added into a repeat group "attached" to the form. How can i do this?
I've added the following code into a XX.js file but this will set every instance of the textarea element to be readonly :
Code:
window.addEvent('domready', function(){
var repeat1 = $('group365').getElements('.fabrikSubGroup').length;
var repeat1 = repeat1 - 1;
var group_suffix1 = '';
for (i=0;i<=repeat1;i++)
{
group_suffix1 = '_' + i;
var com = $('join___661___aplicatii_campanii_ssme_campanii_365_repeat___COMENTARIU'+group_suffix1).value;
if(com != ''){
$('join___661___aplicatii_campanii_ssme_campanii_365_repeat___COMENTARIU'+group_suffix1).setAttribute('readOnly', 'readOnly');
$('join___661___aplicatii_campanii_ssme_campanii_365_repeat___COMENTARIU'+group_suffix1).addClass('readonly');
};//end if
}//end for
});//end function
Thank you