JavaScript Read Only

readOnly is a lovely way of protecting your customer data in a database where some data is preloaded.

The fastest way of implementing this is to use BEs onFocus box when editing a question and add in

That will stop any editing of the box but can break up the flow of tabbing through the document.

Another alternative and the one we recommend is to put in the onFocus box and in the onChange to put

An alternate, but which doesn't work on drop down lists is

When you have data loaded into a database, the customers data will generally be presented to an agent / user. You may not want them editing particular details like a customer Id or reference details.

Simple put a readOnly statement into the onLoad event of the database and those fields will not be editable by the user.

Do NOT use the disabled command as this will cause those fields to be wiped. This is a common mistake in JavaScript coding, where database updates are involved.