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

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 {




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">


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

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


<p> Your Name:<br />

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


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

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


<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" />




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.

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.

Sign in to follow this  

  • Create New...