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

  • Home
  • SEARCH
  • 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 3235704
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:32:14+00:00 2026-05-17T17:32:14+00:00

I have two buttons inside a form call: <% using (Html.BeginForm()) {%> <input type=submit

  • 0

I have two buttons inside a form call:

<% using (Html.BeginForm()) {%>

    <input type="submit" value="Filter" />
    <input type="reset" value="Clear Filter" />

The fields in question:

        <td>
            <%:Html.TextBox("filterId", Model.IdFilter, new {style="width:100px"}) %>
        </td>
        <td>
            <%:Html.TextBox("filterTitle", Model.TitleFilter, new {style="width:500px"}) %>
        </td>
        <td>
            <%:Html.TextBox("filterStatus", Model.StatusFilter, new {style="width:100px"}) %>
        </td>

The first button calls the form action. The second button should either:

  1. Clear the form and not post
  2. Redirect to another action

Not sure why I’m having so much trouble with this, but it seems like there should be a very simple way to do this. However, all the solutions I’ve come across seem way too complicated for this.

Am I missing something?

EDIT: Here’s the solution:

Change the reset button to a plain jane button with an id:

<input type="button" value="Clear Filter" id="clearFilter" />

Then add this script:

    $(function () {
        $("#clearFilter").click(function () {
            $(':input', '#form0')
                .not(':button, :submit, :reset, :hidden')
                .val('');
            $('#form0').submit();
        });
    })
  • 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-17T17:32:14+00:00Added an answer on May 17, 2026 at 5:32 pm

    You may have to write custom script to get the behavior you want. It is a reset button, after all, not a clear button.

    At this point, if you change the values of the controls, then click the rest button, the form will be returned to its original state, of the state of whatever the model was when it was rendered.

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

Sidebar

Related Questions

I've got a form where I have two radio buttons and two interchangeable controls
Imagine you have two buttons on the win form. What do you think should
I have one <form id=inputdefect> ,and one <input id=item> , but inside that I
I have a UINavigationController. In its toolbar is a segmented control with two buttons.
I have created an item swapper control consisting in two listboxes and some buttons
For simplicity lets say I have two flex mxml pages. form.mxml button.mxml If the
I have two applications written in Java that communicate with each other using XML
I have two elements: <input a> <input b onclick=...> When b is clicked, I
I have several DIVs on a page. Inside these DIVs I have several form-elements
I have a webpage where there are two buttons and a textbox. When the

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.