Textarea, readonly and repeat group

sales2010

Well-Known Member
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 :

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
 
can you point us at the page - it would make testing the code a LOT quicker
thx
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top