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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:05:18+00:00 2026-06-13T07:05:18+00:00

I have a ordinary button: <button value=finish_with_send class=finish_with_send>Send</button> I need to validate two fields

  • 0

I have a ordinary button:

<button value="finish_with_send" class="finish_with_send">Send</button>

I need to validate two fields before submission, so i have replaced this button with following:

<a href="javascrtip:void(0)" class="finish_with_send">Send</a>

And the validation:

$(".finish_with_send").click(function() {
if(!$("#feedback_string").val() || !$("#feedback_title_string").val()) {
        // Validation failed, do something  
    } else {
        // Validation suceeded, submit
    }
})

The problem is that i need to submit as done with the previous button where the value came along to recognize submission type:

value="finish_with_send"

Is there a way that to do this again with jQuery?

  • 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-13T07:05:19+00:00Added an answer on June 13, 2026 at 7:05 am

    Keep your <button> (or go for <input type="submit"> which I would recommend for greater browser support)… change your javascript like so:

    $(".finish_with_send").click(function(event) {
    if(!$("#feedback_string").val() || !$("#feedback_title_string").val()) {
            event.preventDefault(); //Stop it submitting.
            return false;
        } else {
            return true; //Carry on.
        }
    })​
    

    And allow your button to submit the form like so:

    <button type="submit" value="finish_with_send" class="finish_with_send">Send</button>
    

    event.preventDefault() stops the default action of an event firing, in the case of a <button type="submit"> it’s default action is to submit the form.

    Working example: http://jsfiddle.net/JUSsf/1/

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

Sidebar

Related Questions

I have a WPF window, which contains a button called Cancel. Under ordinary circumstances
have written this little class, which generates a UUID every time an object of
Let's say I have ordinary *Type class: class LocationType extends AbstractType { /** *
I have an ordinary HTML table: <table> <tr> <td class=first-column-style>FAT</td> <td>...</td> </tr> <tr> <td
Hi I have a listgrid in smartgwt and I need to have a button
I have advanced menu widget and two layers for home page and ordinary content
I have this code in a button click for ratting this app -(IBAction)_clickbtnratethisApp:(id)sender {
I have this <g:select> in a .gsp file. But unlike any ordinary <g:select> 's
I have ordinary activity with Option Menu, which I created by this code: @Override
This is the problem, I have a class MainWindow that extends JFrame in one

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.