Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7702189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:10:17+00:00 2026-05-31T23:10:17+00:00

would someone be able to help me with a button to clear /delete the

  • 0

would someone be able to help me with a button to clear /delete the content of all textareas on a form please?

I’ve already tried this approach:

<input type="reset" value="restart" />

but because the textareas are populated with data from the database upon load then it doesn’t actually do anything (unless I want to re-set the form back to it’s original state).

Can I do this with some code on the view? Or will I need to add some bits to the controller as well?

I’m using ASP.Net MVC Razor C# Microsoft Visual Web Developer 2010 Express.

Code for the View page is below:

@model DFAccountancy.Models.Data

@{
    ViewBag.Title = "Update";
}



<h2>Update</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript">    </script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"     type="text/javascript"></script>

<script type="text/javascript">
    $(function () { $("test").click(function () { $("textArea").val(""); }); });
</script>

@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
    <legend>Data</legend>

    <div class="editor-label">
        @Html.LabelFor(model => model.para1)
    </div>
    <div class="editor-field">
        @Html.TextAreaFor(model => model.para1, new { cols = 75, @rows = 5 })
        @Html.ValidationMessageFor(model => model.para1)
    </div>

    <div class="editor-label">
        @Html.LabelFor(model => model.para2)
    </div>
    <div class="editor-field">
        @Html.TextAreaFor(model => model.para2, new { cols = 75, @rows = 5 })
        @Html.ValidationMessageFor(model => model.para2)
    </div>

    <p>
        <input type="submit" value="Update" />
    </p>
    <p>
        <input type="reset" value="Re-Start" />
    </p>
    <p>
        <input id="test" type="button" />
    </p>

</fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:10:18+00:00Added an answer on May 31, 2026 at 11:10 pm

    Since you’re using JQuery you could assign all text areas a class and then do:

    $(function () {
       $(".textArea").text('');
    }
    

    This would clear all text areas once the document has loaded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope that someone would be able to help me to solve this simple
I was wondering if someone would be able to help me write a CQL
would someone please write this code: this.Loaded += (s, e) => this.loaded = true;
I wonder whether someone may be able to help me please. I've put some
I really hope someone will be able to help me out with this. I
I wonder whether someone may be able to help me please. I've been working
Would someone be able to help here? I would like to fill a div
I'm rubbish at regular expressions, so would someone be able to help me find:
Would someone be able to break down the Ruby specifics of what each of
I was wondering if someone might be able to help me solve the Lotka-Volterra

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.