Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Area Box

Status
Not open for further replies.

RebelFox

Programmer
Jun 16, 2002
62
GB
I have a text area on a page to accept values posted to a database via ASP. I use another text box on another page designed to look like the entry page to show the text box contents. The problem is that I am having trouble manipulating the text page on the display only page.

First of all I cannot find a way of stating the font type and size for the text box content. In dream weaver I don't get an otion for font and sie when I highlight the text area.

Secondly I cannot prevent users typing into the text area. My display only page doesn't do anything with any text the user puts in but I need to prevent them from typing into the text area to do a proper job.

Thanks.
 
Here's a very clever way of doing it that I picked up in a foxhole in The War of New Brunswick:

Code:
<input size=&quot;6&quot; type=&quot;text&quot; disabled name=&quot;VHSTOTJSubTotal&quot; value=&quot;$0.00&quot; onFocus=&quot;VHSTOTJSubTotal.blur()&quot;></input>

Sure, &quot;disabled&quot; stops some of it, but the really clever bit is the onFocus line. If they try to click on it, the cursor is bounced away to (I think) the previous control. Or the next. It doesn't matter, as long as they keep out of this one.

Cheers,

Edward &quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
you can format the text area font using css or inline styles...

to use inline styles you would do something like this...

<textarea ... style=&quot;font-family: Verdana; font-size: 10px; font-color: #ff0000;&quot;>

or to use css, just include something like this in your stylesheet...

textarea { font-family: Verdana; font-size: 10px; font-color: #ff0000; }

hope this helps,

ss...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top