check that readonly and attributes has true values

with this change you must apply https://github.com/joomla/joomla-cms/pull/2531 fix too.