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 Saturday, August 20, 2011 Total Views:  

In this example, we have a button and input text boxes in  the form, we will clear all text boxes  when user type any text in the text boxes it can be clear through clear form button.


Lets see the example

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title></title>

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>

    <script type="text/javascript">

        $(function () {

            $("#<%=Button1.ClientID %>").click(function (e) {

                $("form input")

                .not(':reset, :submit, :hidden, :button')

                .val("");

                return false;

            });

        });

    </script>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <p>

            Name:<asp:TextBox ID="tbName" runat="server"></asp:TextBox></p>

        <p>

            Email Address:<asp:TextBox ID="tbemail" runat="server"></asp:TextBox></p>

        <p>

            Birthday:

            <asp:TextBox ID="tbbirth" runat="server"></asp:TextBox></p>

        <p>

            Alternative Email Address<asp:TextBox ID="tbAltEmail" runat="server"></asp:TextBox></p>

        <p>

            <asp:Button ID="Button1" runat="server" Text="Clear form" />

            <asp:Button ID="Button2" runat="server" Text="Submit" />

        </p>

    </div>

    </form>

    <p>

        Author:Aamir Hasan

        <br />

        <a href="http://www.aspxtutorial.com">Free online asp.net tutorial</a>

    </p>

</body>

</html>

As you can see, we have used val() function to clear the text from all boxes in the form

Note: Make sure that all input textboxes should be within the form tag.

Download

Clear-textbox.aspx (1.68 kb)

See live demo

Category: All | jQuery
Protected by Copyscape Online Plagiarism Tool

Comments (15) -

Fake Oakleys
Fake Oakleys People's Republic of China
8/26/2011 2:10:42 PM #

We should have a pair of Oakley Lifestyle Sunglasses as must-

have travel items in summer,because the ultraviolet is so

strong ,we need oakley sunglasses to protect our eyes. If you

are choosing cheap  sunglasses,in this web you can choose Fake

Oakley Lifestyle Sunglasses which is more cheaper than

others.There have a lot of style of sunglasses for your choice,

you can find a pair of suitable sunglasses.It will be you best

choice.YYYIUJN4LLXY
www.cheapoakleysunglasses4u.net/.../how-to-

choose-good-oakley-sunglasses/

Fake Oakleys
Fake Oakleys People's Republic of China
8/26/2011 2:11:56 PM #

We should have a pair of Oakley Lifestyle Sunglasses as must-

have travel items in summer,because the ultraviolet is so

strong ,we need oakley sunglasses to protect our eyes. If you

are choosing cheap  sunglasses,in this web you can choose Fake

Oakley Lifestyle Sunglasses which is more cheaper than

others.There have a lot of style of sunglasses for your choice,

you can find a pair of suitable sunglasses.It will be you best

choice.YYYIUJN4LLXY
www.cheapoakleysunglasses4u.net/.../how-to-

choose-good-oakley-sunglasses/

ugg boots sale
ugg boots sale United States
9/18/2011 5:15:06 PM #

Generally a vehicle accident lawyer may charge a particular percent from the money that you'll be granted out of your personal injuries suit,uggs outlet classic tall pink, however in the situation you don't reside in the locality they work they might also impose a fee to pay for their traveling expense in case they need to go some lengthy distance to deal with your situation. In whatever way it's important to become familiar with what costs is going to be needed before you decide to employ a lawyer. By doing this you'll make certain that theUltra Short Boots services you go searching for are actually affordable.Today we live underneath the rule of law. Practically in most the nations individuals have their privileges, and frequently they have to safeguard them because the world still is not perfect. Individuals that are suffering from personal injuries and residing in Toronto may make reference to Toronto Personal Injuries Lawyers. But such injuries aren't just one danger we are able to face. Many individuals use a vehicle today which relates to many risks too, and here Vehicle Accident Lawyers might help you. Yet another type of quite possible and common violation of law is malpractice,<a href="">UGG Classic Mini Boots 5854</a> and here the best persons torecourse are Malpractice Lawyers.RF5K19R53AFFSAV

Hermes Handbags
Hermes Handbags People's Republic of China
9/21/2011 11:27:07 PM #

YYCRC4CK7N1LSL

Cheap Moncler Jackets
Cheap Moncler Jackets United States
9/27/2011 4:26:13 PM #

I feel strongly about information and love learning more on this. If possible, as you gain expertise, It is extremely helpful for me. would you mind updating your blog with more information?

cheap ugg boots
cheap ugg boots People's Republic of China
10/6/2011 4:14:54 PM #

UGG Classic Short Boots add some color to your winter life
YYC74Y7JZ0RXYY

cheap ugg boots
cheap ugg boots People's Republic of China
10/6/2011 4:15:04 PM #

UGG Classic Short Boots add some color to your winter life
YYC74Y7JZ0RXYY

cheap ugg boots
cheap ugg boots People's Republic of China
10/6/2011 4:15:11 PM #

UGG Classic Short Boots add some color to your winter life
YYC74Y7JZ0RXYY

North Face Sale
North Face Sale People's Republic of China
10/12/2011 1:06:46 AM #

Now, more than 40 years after its humble grand opening, [url=http://www.nfonsale.com]The North Face Sale[/url] has never stopped exploring and delivers an extensive line of performance apparel, equipment, and footwear. We push the boundaries of innovation so that you can push the boundaries of exploration. We remain deeply proud to push the [url=http://www.nfonsale.com]North Face Jackets On Sale[/url].

north face sale
north face sale People's Republic of China
11/10/2011 3:15:58 PM #


Great blog, just looking around some blogs, seems a pretty nice platform you are using. I'm currently using Wordpress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?

barbour ashby
barbour ashby People's Republic of China
12/2/2011 4:34:59 PM #

There are many brands of barbour Shoreman Jacket in the market today. Each of the brand promises to bring out something new to the customers. barbour fusilier is also a renowned and reputed brand in the market. This brand is in fact reputed for the jackets barbour . You can purchase a Barbour enduro leather jacket and you would be amazed to find yourself. There are different varieties in the barbour jacket that you would get in the market.We will try to provide you few varieties of the barbour scott bracken jacket that are available in the market. The barbour jackets is basically a classically designed and styled Barbour combat coat. http://www.uk-barbourjacket.com/

cheap ugg boots uk
cheap ugg boots uk People's Republic of China
1/18/2012 4:41:44 PM #

Nice classic short boots with the able adroitness and abundant affection are account of your purchasing. These ugg boots sale are able-bodied fabricated with the artistic design. With the heel bouncer apparent with http://www.ugg-snow-boot.org/, these ugg boots do attending actual timeless.  

dofus kamas
dofus kamas Nicaragua
2/24/2012 5:53:58 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:28:43 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.

fddf
fddf People's Republic of China
3/31/2012 9:08:47 PM #

http://www.louisvuittononlineoutletus.com

Buy  Clomid Online
Buy Clomid Online United States
4/19/2012 11:16:22 PM #

Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!

http://www.bigdrugstores.com/clomid-generic-.html

Buy  Flagyl Online
Buy Flagyl Online United States
4/19/2012 11:18:04 PM #

I love it when things get improved, thanks for putting up a great guide. Hope it will help me out in my future projects

http://www.bigdrugstores.com/flagyl-generic.html

fafafa
fafafa Slovenia
4/23/2012 2:08:30 AM #

http://www.christianlouboutinukk.org   christian louboutin
http://www.tiffanyuks.org   tiffany uk
http://www.gucciukbeltuk.org   gucci belt
http://www.frsaclouisvuittonsac.com   louis vuitton sac
http://www.chanelukoutletuks.org   chanel outlet
http://www.burberryukoutletuk.org   burberry
http://www.poloralphlaurenuko.org   ralph lauren uk

http://www.nicerjerseys.net
http://www.nicerjerseys.net United States
5/8/2012 6:42:36 PM #

Hello, friends! Welcome to http://www.nicerjerseys.net . We offer the nicer jerseys, caps and so on. We have updated a lot of jerseys such as: NFL, MLB, NBA, women jerseys and youth jerseys. If you pay by Western Union , you’ll get 10% discount. We can give you the best discount. If you have any question please ask me or email me. Thanks a lot for looking around and ordering.

christian louboutin uk outlet
christian louboutin uk outlet People's Republic of China
5/17/2012 9:38:45 PM #

Imagine your guest as they arrive, since christian louboutin uk outlet are so brilliant, all you need to do is walk by them and they will catch the light and sparkle. Getting your hands on christian louboutin uk can be a hefty investment of hundreds of dollars.But do not despair,the christian Outlet store could be the answer to your prayers. After only a few minutes with a Swarovski scope, even before it is mounted-let alone used-you will know why christian louboutin outlet is synonymous with quality. The care and attention to detail in Swarovski scopes is clear from every angle, and promises years of sturdy and reliable service.

http://www.christianlouboutins-ukoutlets.co.uk

Pingbacks and trackbacks (2)+

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5