How to loop through all text fieds in a form
I have a form, with a bunch of text fields in it. I want to have Edit and Save buttons. Edit buttons to edit the form and save to save it. When its saved, all the text fields are shown as read-only by setting "setReadOnly" to TRUE.
Currrently, I have this routine to set read/write:
privatevoid setReadWrite(){
// Set read-only to true for all text fiels
this.btnEdit.setVisible(_readOnly);
this.btnSave.setVisible(!_readOnly);
this.user_id.setReadOnly(_readOnly);
this.user_email_client.setReadOnly(_readOnly);
this.user_email_office.setReadOnly(_readOnly);
this.user_fname.setReadOnly(_readOnly);
this.user_lname.setReadOnly(_readOnly);
this.user_id.setReadOnly(_readOnly);
this.user_password.setReadOnly(_readOnly);
this.user_password_conf.setReadOnly(_readOnly);
this.user_phone_cell.setReadOnly(_readOnly);
this.user_phone_cell_aac.setReadOnly(_readOnly);
this.user_phone_client.setReadOnly(_readOnly);
this.user_phone_home.setReadOnly(_readOnly);
this.user_phone_office.setReadOnly(_readOnly);
}
Is there an easier way to look through all text fields in a form instead of naming each one of them? That way, I can re-use the same code in every page/form in the app.
Thanks
Message was edited by:
Sabir

