I don’t know the reason why you use custom html id/name - perhaps for access from js code - but a different approach might be to use CHtml::activeId($model, ‘someAttribute’) to generate the client-side id. Of course only an option if you publish your javascript from a Yii PHP-script.
I guess you want to access your form elements from js and avoid those lengthy ids/names. Instead, you could add custom CSS class names to identify your input elements, and leave name+id untouched. Might feel odd at first, but it’s a perfectly legal thing to do and guaranteed to work in every browser. You could end up with selectors like: