CodeCharge – Disabled Control Not Saving Changes To Database

The way out of this is to change the control to Hidden and then put a visible dummy control to show the associated text which is not bound to the database.

I have a listbox that is disabled and I want it to default to the current logged in user. I get errors saving the record to the database when the listbox is disabled but I don’t have a problem when it is enabled.

So I change the type of input control to Hidden. It stays bound to the database. Then I created another Textbox and show the current username in it. It is not bound to the database.

This may have to do with HTML standards where the values of disabled controls are not returned to the server.

That works.

Capture

Capture1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s