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

  • Home
  • SEARCH
  • 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 169789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:41:36+00:00 2026-05-11T12:41:36+00:00

I have two radio buttons like so <input type=radio name=rush value=yes /> <input type=radio

  • 0

I have two radio buttons like so

<input type='radio' name='rush' value='yes' /> <input type='radio' name='rush' value='no' checked='checked' /> 

What I want to do is when the form submit button is clicked, check if ‘yes’ is selected.

If it is, show a javascript confirm dialog

I’ve gotten this far, but am stuck, any help would be appreciated.

$('form.shipping').submit(function() {      if($('input[name='rush']'.attr('value') === 'yes')     {         if (confirm('Rush orders are subject to an upcharge. (Just wanted to make sure you read the note). Is this ok?'))         {             return true;         }         else         {             return false;         }     }  }); 
  • 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-11T12:41:36+00:00Added an answer on May 11, 2026 at 12:41 pm

    You are binding something to the click event of a button. You probably want to bind it to the submit event of the form. Besides that, you misspelled input.sumbit-button in your selector.

    EDIT: Here is a working version of what you want. Your errors were:

    • You were probably not wrapping your code around document.ready. This is important if your script is included at the top of the page, as anything you write that is not wrapped in this event will execute before the DOM elements are created. So you would be binding events to nothing. The document.ready event takes care of that by firing as soon as the DOM is fully loaded.
    • You had a missing closing ) right before .attr. You should probably look into tools like FireBug to debug your javascript, as it is trivial to find these kind of things with it.
    • You were checking the value of the radio button, but it was always evaluating to true because you need to filter it out to only get the :checked one.

    So, the working code:

    $(document).ready(function() {     $('form.shipping').submit(function() {         if($('input[name='rush']').is(':checked')) {             return confirm('Rush orders are subject to an upcharge.             (Just wanted to make sure you read the note). Is this ok?');         }     }); }); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 83k
  • Answers 83k
  • 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 If the other end doesn't use your application, you should… May 11, 2026 at 4:45 pm
  • Editorial Team
    Editorial Team added an answer You mention a batch file, which probably means that you… May 11, 2026 at 4:45 pm
  • Editorial Team
    Editorial Team added an answer Seems there is no real solution for this problem, but… May 11, 2026 at 4:45 pm

Related Questions

I'm trying to setup a search page which performs two separate kinds of search
Is it possible to swap out the entire View of a ListView in Xaml
I'm looking for a way to implement this design in wxPython on Linux... I
I have a n...n structure for two tables, makes and models . So far

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.