aspx Tutorial

.NET Articles,jQuery demo, asp.net with jQuery, online tutorial,Jquery, SilverLight, Javascript, asp.net,JSON, MVC,.NET Articles,demo, Web Services, .NET articles, Sharepoint 2010, visual studio 2010,Aamir Hasan,IT
Advertise Here

Advertize

wwwSW
Posted by Aamir Hasan   on Thursday, November 4, 2010 Total Views:  

There are lots of factor’s you have to see when you are going to design a website. Website should be human readable and interact the site so user will spend more time on your website. Style is also one big factor of your web site to interact the users. Website should be human readable. In this example I have create a simple form style, when you focus on input text box, jQuery focus event will add CSS class on focus textbox.

Here’s an example


<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
   <title>Change style effect on Input form using jQuery</title>
   <style type="text/css">
       html,body,table
       {
           font-family: Verdana;
           font-size: 12px;
       }
       h2
       {
           font-size: 1.5em;
           line-height: 1em;
       }
       input
       {
           background-color: #f9f9f9;
           border: 1px solid #eee;
           color: #999;
       }
       .add-focus
       {
           border: 1px solid #eaeaea;
           background-color: White;
           color: #666;
       }
   </style>
   <script src="http://code.jquery.com/jquery-1.4.3.min.js" type="text/javascript"></script>
   <script language="javascript">
       $(document).ready(function () {
           $('input[type="text"]').focus(function () {
               $(this).addClass("add-focus");
           });
           $('input[type="text"]').blur(function () {
               $(this).removeClass("add-focus");
           });

       });
  
   </script>
</head>
<body>
   <form id="form1" runat="server">
   <div>
       <h2>
           Change style effect on Input form using jQuery
       </h2>
       <p>
           <table width="500" border="0" cellspacing="0" cellpadding="0">
               <tr>
                   <th width="150" height="25" align="left" valign="top" scope="col">
                       Username:
                   </th>
                   <th width="350" height="25" align="left" valign="top" scope="col">
                       <asp:TextBox ID="tbUsername" runat="server" />
                   </th>
               </tr>
               <tr>
                   <th height="25" align="left" valign="top" scope="col">
                       Email:
                   </th>
                   <th height="25" align="left" valign="top" scope="col">
                       <asp:TextBox ID="tbEmail" runat="server" />
                   </th>
               </tr>
               <tr>
                   <th height="25" align="left" valign="top" scope="col">
                       Password:
                   </th>
                   <th height="25" align="left" valign="top" scope="col">
                       <asp:TextBox ID="tbpassword" runat="server" TextMode="Password" />
                   </th>
               </tr>
               <tr>
                   <th height="25" align="left" valign="top" scope="col">
                       Retype password:
                   </th>
                   <th height="25" align="left" valign="top" scope="col">
                       <asp:TextBox ID="tbRpassword" runat="server" TextMode="Password" />
                   </th>
               </tr>
               <tr>
                   <th height="25" align="left" valign="top" scope="col">
                       &nbsp;
                   </th>
                   <th height="25" align="left" valign="top" scope="col">
                       <input id="btSubmit" type="button" value="Submit" />
                   </th>
               </tr>
           </table>
       </p>
   </div>
   </form>
</body>
</html>

Output

Download

FormStyle.zip (1.21 kb)

Live demo

Category: All | asp.net | HTML | jQuery
Protected by Copyscape Online Plagiarism Tool

Comments (7) -

New Hampshire payday loans
New Hampshire payday loans United States
1/7/2011 8:40:37 PM #

To be truly happy is a question of how we begin and not of how we end, of what we want and not of what we have.

loan application
loan application United States
2/22/2011 3:01:48 AM #

From this day forward, the millions of our schoolchildren will daily proclaim in every city and town, every village and rural schoolhouse, the dedication of our nation and our people to the Almighty. (On signing law for inclusion of the words 'under God' in the Pledge of Allegiance, 14 Jun 54)

V3King
V3King India
4/26/2011 10:16:55 AM #

Very Nice...

jerseys
jerseys People's Republic of China
6/3/2011 8:55:27 PM #

很好, 谢谢。

NBA jerseys
NBA jerseys Malta
7/17/2011 9:07:37 PM #

I think this is one of the most interesting articles I’ve read on this subject. You have made your points interesting, unique and I agree with most. I am glad I found your article today.

Pandora UK
Pandora UK Macao S.A.R.
7/17/2011 9:11:49 PM #

This is great material you have written here. It isn’t often I find content this good. Thank you for making it so interesting and understandable.

dofus kamas
dofus kamas Sri Lanka
2/24/2012 5:54:48 PM #

This is a massively multiplayer online role-playing game, we offer the http://www.mmoigold.com/gold/Dofus_kamas.html dofus kamas , As the Daevas dream, they see Atreia's future The future of Aion—revealed!, the http://www.mmoigold.com/gold/Aion_Gold.html aion gold make you join in the game happy, the www.mmoigold.com/gold/Dungeon_Fighter_Online.html dungeon fighter gold game is so cool, in addition, you can http://www.mmoigold.com/gold/Dragon_Nest.html dragon nest gold in our store.

The North Face Outlet
The North Face Outlet People's Republic of China
3/7/2012 5:29:49 PM #

What could give you warm in cold winter. moncler jackets are a nice choice. Usually they are expensive, but you could buy moncler jackets at our moncler outlet, all are cheap price and best quality. If you want to a clothing for outdoor sports. The North Face Jackets are very popular. And The most professional must be arcteryx jackets. Of Course, if you want to use it for Skiing, Spyder Jackets are essential.

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5