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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:47:58+00:00 2026-06-17T20:47:58+00:00

Hi I have the following in my code. My issue is when handling multiple

  • 0

Hi I have the following in my code. My issue is when handling multiple forms in the same page how to I adjust the code to pick only the relevant form submit?

The JS activates even when an undesired form also submits.

I tried altering the code to look like something $('input[type=submit, name=deletenow]').click(function() { but surely it seems inaccurate. Please help. Thank you for looking.

$(document).ready(function() {

    $('input[type=submit]').click(function() {

    });

    $('input[type=submit]').confirm({
        msg:'Do you really want to delete this?',
        timeout:3000
    });



});
  • 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-17T20:47:59+00:00Added an answer on June 17, 2026 at 8:47 pm

    You shouldn’t be listening for clicks on your submit buttons as that kills accessibility. Instead you should listen for the submit event on the form itself.

    Give your form an ID, and then listen for the submit event using that ID, like so:

    <form id="yourForm" method="POST" action="">
        <input type="submit">
    </form>
    
    $('#yourForm').submit(function(event){
        event.preventDefault();  // Prevents the form from submitting.
    });
    

    The preventDefault method stops the form from submitting. You might want to create some conditions where it’s called instead of stopping it every time like my demo does.

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

Sidebar

Related Questions

I'm having an issue with rails involving javascript. Basically, I have the following code:
I have an issue with using the following code in my CakePHP app. In
I have got the following issue, my function appends code to a string $string
I have following code. ASPX Page <a href=AnyASPXPageOfWebsite.aspx onclick=javascript:CallJQuery(); > Set Price </a> JS
OK guys so the issue is that I have following code: HttpWebRequest req; HttpWebResponse
I have the following code. My issue is I'm trying to parse a simple
So I have some strange issue with nl2br so I have the following code:
I have the following code on a page where users can create posts: <script>
I have the following piece of code for handling exceptions in my web application:
I have the following vba code is part of a larger script. The issue

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.