Jump to content
Stef's Coding Community
Sign in to follow this  
grabenair

css user input not working

Recommended Posts

The link http://www.robertswebdesigns.com/contact_me.htm

 

My problem is I want the input boxes to change color when clicked on. I wrote

 

input.text:focus, textarea:focus {

background:#191919;

color:#FF0;

}

The textarea:focus works and the the text:focus does not.

 

The form

 

<div id="frmContent">

<form action="http://www.robertbonnerswebdesigns.com/cgi-sys/formmail.pl" method="post"name="hgmailer">

<p>

<input type="hidden" name="recipient" value="robert@robertbonnerswebdesigns.com" />

<input type="hidden" name="subject" value="FormMail E-Mail" />

</p>

<p> Your Name:<br />

<input name="name" type="text" onClick="MM_effectHighlight(this, 1000, '#ffffff', '#ff0000', '#ffffff', false)" value="" size="30" />

</p>

<p><br /> Your E-Mail:<br />

<input type="text" name="email" size="30" value="" />

</p>

<p><br /> Message:<br />

<textarea name="comment" cols="50" rows="5"></textarea>

<br /><br />

<input type="button" value="E-Mail Me!" onClick="hgsubmit();" />

<input type="hidden" name="redirect" value="http://www.robertbonnerswebdesigns.com" />

</p>

</form>

</div>

Edited by grabenair

Share this post


Link to post
Share on other sites

"input.text:focus" refers to an input with a class of text that has been focused on.

 

You can use "input[type=text]:focus", which selects inputs with a type of text that have been focused on, but that uses CSS3 and it isn't fully supported across all browsers.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...