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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top