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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:29:36+00:00 2026-05-12T11:29:36+00:00

I have OnClientClick=return confirm(‘Make Payment?’); tied to an asp:Button. It works fine, however, prior

  • 0

I have
OnClientClick=”return confirm(‘Make Payment?’);”

tied to an asp:Button. It works fine, however, prior to popping up this confirm tho, I need to check if a textbox contains a value… How can I do this?

I need a function to return false if the textbox value is null or empty, otherwise i want to present the user with the confirm. It’s not necessary if the text is null or empty. In fact if it is I would like to alert the user and return to the form to edit it. Never even showing the confirm.

Can anyone help?

Cheers,
~ck

  • 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-12T11:29:37+00:00Added an answer on May 12, 2026 at 11:29 am

    How about this:

    <script type="text/javascript">
    function CheckForSubmission(txtBoxID) {
        var txtBoxEle = document.getElementById(txtBoxID);
        if (txtBoxEle == null) {
            return false;
        }
        else if (txtBoxEle.value == '') {
            alert('Please enter a value');
            txtBoxEle.focus();
            return false;
        }
        return confirm('Make Payment?');
    }
    </script>
    
    OnClientClick="return CheckForSubmission(this.id);"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a button like <asp:Button ID=Button1 runat=server Text=Submit onclick=RedirectToLocker OnClientClick=return false; UseSubmitBehavior=false />
I have the following code: <telerik:RadAjaxPanel ID=RadAjaxPanel1 runat=server LoadingPanelID=rlpMain> <asp:ImageButton ID=ImageButton1 runat=server OnClientClick=return confirm('Are
I have an asp button with no onclick event but only onclientclick. This call
I have a asp.net webform with a button. The OnClientClick event is wired to
I have created a keyboard using asp:button control. Onclientclick event it will display the
I have a usercontrol in ASP.Net featuring a button that I use to postback.
I have an Asp server control button for which I have onClick for processing
I have an ASP.NET form with a cancel button that is supposed to, after
I have an asp.net TextBox control on my page and a search button whenever
i have some requiredfieldvalidators. when i have a regular asp:button, all goes well. But,

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.