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 7970241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:22:03+00:00 2026-06-04T07:22:03+00:00

Am using master page in my asp.net application, and I want to reset the

  • 0

Am using master page in my asp.net application, and I want to reset the fields when I click the Cancel button.

I can achieve this by adding the onClientClick event as

OnClientClick="this.form.reset();return false;"

its working but, I already used this function for showing the confirm cancel popup like,

OnClientClick="return confirmCancel()"

this confirmCancel() is written in the js file called Custom.js and its under the folder called Script.

I need to show this confirmCancel() pop up and if I give ok it should clear the form, how can I achieve this, can anyone help me here…

this is the confirmCancel() method

function confirmCancel() {
var c = confirm("Confirm Cancel?");
if (c) {
    return true;
}
else {
    return false;
}
}
  • 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-06-04T07:22:04+00:00Added an answer on June 4, 2026 at 7:22 am

    You can make

    OnClientClick="return (confirm('Clear Form ?') && this.form.reset(),false)"
    

    I make a simple test here: http://jsfiddle.net/LY3dd/4/

    What I do here, by adding the && the javascript first run the confirm and if this is return true, then is run the second part that is the reset. If the confirm return false, is stop there (and not clear the form).

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

Sidebar

Related Questions

I'm using Master Page in my ASP.net application, in the master page I put
I have an ASP.NET MVC application I'm building and I'm using a Master page.
I am using Asp.Net/C# in my application.I have a menu on my master page
Good day everyone, I am building a page in ASP.NET, and using Master Pages
How to Update a div tag in Master Page using a button click in
I've got a master page in a root folder of an asp.net application and
I have an ASP.NET / C# application in which the Master Page contain the
This is the scenario: I'm working on a new ASP.NET application that uses master
I am developing an ASP.NET Web application. I create a master page. The master
I am implementing a web application using ASP.NET MVC3. In the application I want

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.