Making a Textbox "readonly" usind textbox.Attributes("")

  • Thread starter Thread starter Daren Hawes
  • Start date Start date
D

Daren Hawes

Hi

I need to add an attribute to a Textbox to make it read only.

To add a CSS I use

DeptDate.Attributes("Class") = "textInput"

That adds 'Class="textinput"', but the readonly is like..

<Input readonly Class="xxx" ...

How can I programatically ad the readonly bit if it doeas not have a
name like "Class" doeas?

Thx Daren
 
<Input readonly Class="xxx" ...

How can I programatically ad the readonly bit if it doeas not have a
name like "Class" doeas?

readonly="readonly"

Looks silly but that's how you handle the "parameter-less" attributes
nowadays.
 
Hi Daren,

Assuming you are using a webform, why not just a label with a nice border.

Cor
 
Back
Top