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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:25:51+00:00 2026-05-11T01:25:51+00:00

Like every other web developer on the planet, I have an issue with users

  • 0

Like every other web developer on the planet, I have an issue with users double clicking the submit button on my forms. My understanding is that the conventional way to handle this issue, is to disable the button immediately after the first click, however when I do this, it doesn’t post.

I did do some research on this, god knows there’s enough information, but other questions like Disable button on form submission, disabling the button appears to work. The original poster of Disable button after submit appears to have had the same problem as me, but there is no mention on how/if he resolved it.

Here’s some code on how to repeat it (tested in IE8 Beta2, but had same problem in IE7)

My aspx code

<%@ Page Language='C#' CodeFile='Default.aspx.cs' Inherits='_Default' %>  <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>  <html xmlns='http://www.w3.org/1999/xhtml'> <script language='javascript' type='text/javascript'>     function btn_onClick()     {         var chk = document.getElementById('chk');         if(chk.checked)         {             var btn = document.getElementById('btn');             btn.disabled = true;         }     } </script> <body>     <form id='form1' runat='server'>         <asp:Literal ID='lit' Text='--:--:--' runat='server' />         <br />         <asp:Button ID='btn' Text='Submit' runat='server' />         <br />         <input type='checkbox' id='chk' />Disable button on first click     </form> </body> </html> 

My cs code

using System;  public partial class _Default : System.Web.UI.Page  {     protected override void OnInit(EventArgs e)     {         base.OnInit(e);         btn.Click += new EventHandler(btn_Click);         btn.OnClientClick = 'btn_onClick();';     }      void btn_Click(object sender, EventArgs e)     {         lit.Text = DateTime.Now.ToString('HH:mm:ss');     } } 

Notice that when you click the button, a postback occurs, and the time is updated. But when you check the check box, the next time you click the button, the button is disabled (as expected), but never does the postback.

WHAT THE HECK AM I MISSING HERE???

Thanks in advance.

  • 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. 2026-05-11T01:25:52+00:00Added an answer on May 11, 2026 at 1:25 am

    I think you’re just missing this tag:

    UseSubmitBehavior='false' 

    Try it like this:

    <asp:Button ID='btnUpdate' runat='server' UseSubmitBehavior='false' OnClientClick='if(Page_ClientValidate()) { this.disabled = true; } else {return false;}' Text = 'Update' CssClass='button' OnClick='btnUpdate_Click' ValidationGroup='vgNew'/> 

    Explanation

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

Sidebar

Ask A Question

Stats

  • Questions 96k
  • Answers 96k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Create the strings <providername>000001, <providername>000002, etc. or whatever and encrypt… May 11, 2026 at 7:15 pm
  • Editorial Team
    Editorial Team added an answer You could try using SWFObject and put something like this… May 11, 2026 at 7:15 pm
  • Editorial Team
    Editorial Team added an answer Not sure if it's the "best", but this is probably… May 11, 2026 at 7:15 pm

Related Questions

There are lots of web application frameworks available these days, for pretty much every
Several times in my career, I have worked in a software group that determined
I'm a lone developer who would like to get some structure to my projects.
Our organization started on the SharePoint path about two years ago. Before that, we

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.