Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 11th, 2005, 11:47 PM
Friend of Wrox
Join Date: Jun 2004
Location: Alhambra, ca, USA.
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to set textbox property to readonly when text

Not familar with Asp but I am very familiar with ASP.NET.
When a database column, Status, has string ='enrolled' all the textboxes on the form (over 50 textbox) property should be readonly. What is the best way to do this?
Some examples please. Thank you

Reply With Quote
  #2 (permalink)  
Old July 12th, 2005, 12:06 AM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41

I assume you mean textArea? Dont know if its the 'best way' but I would:

1..get records
2..Assign a true false state to variable:
dim disableTxtArea
disableTxtArea = false
IF rs("status") = "enrolled" then disableTxtArea = true END IF
3..Now assign it accordingly, EG:
<textArea <%if disableTxtArea then%> disabled <%end if%></textArea>

IMO disabled is better than read only. Read only does not dim the text, users think there is a problem on the page. Disabled dims the text and makes it clear that 'there is something different about these textAreas'.

You have the string 'enrolled' in a column, this is poor normalization. I would have a tables called status. Enrolled apears in there once and links to your main table, this way a single integer represents an enrolled status. This way you can add to the status tble using a cms page etc.....

Wind is your friend
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Set the Text Property of Label Control via JavaScr AbrarNazeer Java Basics 0 August 24th, 2006 01:46 AM
Set the Text Property of Label Control via JavaScr AbrarNazeer ASP.NET 2.0 Professional 0 August 24th, 2006 01:41 AM
Can't set text property of dynamic text box sreerajrs ASP.NET 1.0 and 1.1 Professional 1 May 31st, 2006 09:39 PM
Set Default text in a textbox to whats in the prev marcin2k Access VBA 1 September 19th, 2005 08:55 AM
TextBox.Text property returns only old value? humour General .NET 9 August 3rd, 2004 07:01 AM

All times are GMT -4. The time now is 07:05 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.