TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-15-2008, 02:32 PM   #1 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 28
Thanks: 9
bmathers is on a distinguished road
Default making text boxes a different color?

hi,

im sure this is simple but im having trouble making some of my text input boxes a different color. This is the form,

<input name="Email" type="text" id="Email" size="50"/>

and this is how i thought i could do it but it deosnt seem to work when i upload it;

<input name="Email" type="text" id="Email" size="50" STYLE="background:ffcc33"/>

any help would be appreciated

cheers
bmathers is offline  
Reply With Quote
Old 02-15-2008, 02:51 PM   #2 (permalink)
The Addict
Upcoming Programmer Top Contributor 
 
Rendair's Avatar
 
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
Rendair is on a distinguished road
Default

You can easily do this using CSS in the header

PHP Code:
<style type="text/css">

input{

   
bordersolid thing;
   
background-color#000000;
   
color#FFFFFF; 

}

textarea{

   
bordersolid thing;
   
background-color#000000;
   
color#FFFFFF;  
}

</
style
That will then change all text boxes on the page to them settings and all text areas to them settings.
__________________
www.jooney.co.uk - the online portfolio
Send a message via MSN to Rendair
Rendair is offline  
Reply With Quote
Old 02-15-2008, 02:54 PM   #3 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 28
Thanks: 9
bmathers is on a distinguished road
Default

thanks for the reply, i know i can do that but i only want the required fields a different color. so i can only do it individually.
bmathers is offline  
Reply With Quote
Old 02-15-2008, 02:56 PM   #4 (permalink)
The Addict
Upcoming Programmer Top Contributor 
 
Rendair's Avatar
 
Join Date: Nov 2007
Location: UK
Posts: 319
Thanks: 18
Rendair is on a distinguished road
Default

If you wish to change a certain fields colour then you can set a class name for it

PHP Code:
<style type="text/css">

.
MyField{

   
bordersolid thin;
   
background-color#000000;
   
color#FFFFFF; 

}

</
style
PHP Code:
<input name="Email" type="text" id="Email" size="50" class="MyField"
or you can simply use the id of that field instead of creating a class attribute

PHP Code:
<style type="text/css">

#Email{

   
bordersolid thin;
   
background-color#000000;
   
color#FFFFFF; 

}

</
style
PHP Code:
<input name="Email" type="text" id="Email" size="50"
__________________
www.jooney.co.uk - the online portfolio
Send a message via MSN to Rendair
Rendair is offline  
Reply With Quote
The Following User Says Thank You to Rendair For This Useful Post:
bmathers (02-15-2008)
Old 02-15-2008, 06:46 PM   #5 (permalink)
The Acquainted
 
wGEric's Avatar
 
Join Date: Nov 2007
Posts: 166
Thanks: 0
wGEric is on a distinguished road
Default

Code:
<input name="Email" type="text" id="Email" size="50" STYLE="background: #ffcc33"/>
You need the number sign in front of the hexidecimal color number in order for yours to work. Everything else looks correct.
__________________
Eric
wGEric is offline  
Reply With Quote
The Following User Says Thank You to wGEric For This Useful Post:
bmathers (02-17-2008)
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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


All times are GMT. The time now is 07:30 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design