change font property on keypress

I have a textbox which by default/design I set to italic and font color  as gray.
I would like to set it to normal and black when I enter data in the textbox.
I could not find a  keypress event.
Also Id  like only characters and no numbers are allowed in it.
zachvaldezAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zachvaldezAuthor Commented:
im looking the way the searchbutton works on this page.. look up to the right please.
0
COBOLdinosaurCommented:
You are not getting any responses, because you have not posted any code or a link.

Cd&
0
guru_samiCommented:
Asp.net textbox doesn't have a built in key events. You will need jquery for that.
0
InsoftserviceCommented:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head>
  <title>Love to marry an free matrimonial website</title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
    <script type="text/javascript">


  function PressEnter(myfield,e,callback)
  {
       var keycode;
       if (window.event) keycode = window.event.keyCode;
       else if (e) keycode = e.which;
       else return true;

       if (keycode == 13)
         {
         if (callback) {
              eval(callback);
         }
        
         return false;
         }
       else
         return true;
  }

function colorChange()
{
 var field =   $('#testfield');
 field.css({ "color": "black", "font-weight": "normal" });

}
</script>
<body>
<form name='frm'>
<input type=text" id="testfield" onkeypress="return PressEnter(this,event,'colorChange()');" style="color:red;font-weight:bold"  >
</form>
 </body>
</html>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.