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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:16:03+00:00 2026-06-06T04:16:03+00:00

I am having a JQuery/ASP issue that I hope someone can help me with.

  • 0

I am having a JQuery/ASP issue that I hope someone can help me with.

Scenario: ASP.net application already built and deployed, but in the interest of keeping all clients on the same version (easier to update), I’ve injected a lot of JQuery to customize the ASP application for this client to avoid recompiling the code and having them on a “one off” version.

Here’s what I’m trying to do:

Add validation on a form. Currently I’m grabbing the click event of a “submit” button and doing if statements and checking fields for empty values. IE:

$("input[id*=btnVisualSubmit]").click(function(event) {     
    if ($("#field").val() == "")
        event.preventDefault();
        alert("field is empty.  ");
});

It’s a bunch of if/else statements that checks each field for empty strings. Now.. what I want to happen is.. if none of those if statements occur, then the normal ASP button to function as is and do all of the code behind. This works fine and dandy so long as the user inputs all of the required fields on the first try. But as soon as I hit the event.preventDefault(), it NEVER submits the form after the user inputs all required fields.

I’ve tried everything from changing event.preventDefault() to “return false” to adding a last “else” statement that just returns a “true” but nothing invokes the submit button unless the user enters all valid data correctly on their first try.

Any help would greatly be appreciated. Thanks

  • 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-06T04:16:05+00:00Added an answer on June 6, 2026 at 4:16 am

    I have used form on submit .see the below code

    <body>
        <form id="one"   action="JqueryEvent.html">
            <input type="text" id="abc" />
            <input type="submit" />
    
        </form>
        <script type="text/javascript">
            $("#one").on("submit", function () {
                if (jQuery("#abc").val() == "") {
                    alert("clicked");
                    return false;
                }
    
            });
        </script>
    </body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a aomplex and well-running application in ASP.NET that i have created
I'm having some issues with an asp.net implementation of this JQuery facebook style autocomplete
In VS2010 and ASP.NET MVC 2, it seems that client-side validation (JQuery Futures or
I am having issues calling an ASP.NET web service in JQuery. I am basically
Having issues getting jQuery to work in this scenario: Visual Studio 2010 .Net 4.0
I currently have a ASP.Net MVC web application that needs to upload large files
I am using SignalR in an ASP.Net Web Application project and am having issues.
I have an issue with having a asp.net Grid View loaded into a div
I am using ASP.NET MVC3 with the jQuery Datatable plug in. I am having
I am having trouble using JQuery with ASP.net. I have a HTML img ,

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.