SoftwareGeek
SoftwareGeek

Reputation: 15772

ASP.NET - server side control & javascript interaction

on a page with textbox control, lets say this textbox is disabled on server side page load. What would happen if a javascript tries to set visibility of the textbox to false ?

Edit: Can the textbox be hidden by javascript even though it's disabled ?

TIA

Upvotes: 1

Views: 827

Answers (2)

Walie
Walie

Reputation: 1

controlID.Attributes.Add("disabled", "true");
This disables the control...

controlID.Attributes.Remove("disabled");
This enables the control.

Upvotes: 0

Nate
Nate

Reputation: 30636

Yes, setting disabled on the serverside only adds the disabled attribute.

Upvotes: 1

Related Questions