Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 07-20-2005, 11:31 AM   #1 (permalink)
WmFenn
Registered User
 
Join Date: Jul 2005
Posts: 3
WmFenn is on a distinguished road
changing Field colors

This is probably a dumb question, but how do I change the fill color of a field?

Background:

I have a form being validated through ASP using Regular Expressions to look for invalid characters. If an invalid character is found, then I want the cursor to focus in on the field and either highlight the text or change the color of the field.

Thanks
WmFenn is offline   Reply With Quote
Old 07-20-2005, 11:59 AM   #2 (permalink)
nimaj
Registered User
 
Join Date: Jan 2004
Location: Poughkeepsie, NY
Posts: 18
nimaj is on a distinguished road
Send a message via AIM to nimaj Send a message via Yahoo to nimaj
With CSS, you can change the background-color property. Maybe you can do that through JavaScript somehow.
nimaj is offline   Reply With Quote
Old 07-20-2005, 12:00 PM   #3 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,710
redhead is on a distinguished road
I'm gettign confused here, first I thought it was just going to be some form of table fill in color, but when you say "Focusing cursor in field" I think it's more an input field you want to change color in. For this you can use CSS, this example might give you an idear.
Code:
<html>
<head>
<style TYPE='text/css'>
<!--
   INPUT     {font-family: verdana, arial, helvetica,sans-serif;font-size: 8pt;}
   .red{
	background-color:#FF0000;
        color: #FFFFFF;
   }
   .white{
	background-color:#FFFFFF;
        color: #000000;
   }
// -->
</style>
</head>
<body>
<form>
Red style: <input type='text' class='red'><br>
White style: <input type='text' class='white'>
</form>
</body>
</html>
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is online now   Reply With Quote
Reply

Bookmarks

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
regex for allowed characters in a form field DogTags PHP 1 03-13-2005 08:42 AM
At least one non-empty field - whitespace issue DogTags HTML, XML, Javascript, AJAX 4 03-10-2005 12:29 PM
Calculated field in Access 2003 form codeboi MS Technologies ( ASP, VB, C#, .NET ) 1 03-03-2005 06:55 AM
SQL- Calculated Field fdtoo Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 0 09-04-2004 12:37 AM


All times are GMT -8. The time now is 07:06 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting