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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:25:49+00:00 2026-06-02T04:25:49+00:00

I have a registration form that i’m creating. In my html file, I have

  • 0

I have a registration form that i’m creating. In my html file, I have two radio boxes,

<input type="radio" name="whatever" value="0" id="whatever" checked//> No
<input type="radio" name="whatever" value="1" id="whatever"> Yes

If the value is 1 it should send an email using ajax, here is what I have,

if($("input[name='whatever']").val()=='2'){
    $.ajax({
        type: 'POST',
        url: base + 'email',  
        data: vData,
            success: function() {  
              // alert( "I'm the callback")
          } 
    });
}

Thanks in advance for the help.

  • 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-02T04:25:50+00:00Added an answer on June 2, 2026 at 4:25 am

    Start by fixing your markup so that you don’t have duplicate ids:

    <input type="radio" name="whatever" value="0" checked="checked" /> No
    <input type="radio" name="whatever" value="1" /> Yes
    

    and then you could use the :checked selector to detect the value of the currently selected radio button:

    if($(':radio[name="whatever"]:checked').val() == '1') {
        // the Yes radio button was checked =>
        // you could do your AJAX request here ...
    }
    

    or give your radio buttons unique ids:

    <input id="no" type="radio" name="whatever" value="0" checked="checked" /> No
    <input id="yes" type="radio" name="whatever" value="1" /> Yes
    

    and then:

    if($('#yes').is(':checked')) {
        // the Yes radio button was checked =>
        // you could do your AJAX request here ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a registration form that has a file upload field and i use
I have a page, index.html, that contains both a login and registration form. I
I have a basic form that I'm using for member registration. I'm using the
I have a registration form with common registration fields and two multiple selection Lists
I have a registration form that when the user enters in valid registration data
I have a user registration form that has a password and confirm password field.
I have a working PHP registration form that goes through $_POST[] requests to check
Team I'm creating an iphone application using Sencha Touch. I have registration form ,
I'm working on a simple mobile site that have a registration form for Interest,
I have a registration form that is rendered by the following urlconf -- url(r'^$',

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.