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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:40:27+00:00 2026-06-18T10:40:27+00:00

I have made an ajax based form for the website, it takes input from

  • 0

I have made an ajax based form for the website, it takes input from the user and sends it to the database. All fields are working fine but there is a problem with the radio buttons in sending the values.
My code for the ajax is

 <script type="text/javascript">
 function emp1() {
    .....................
xmlhttp.send("firstname=" + firstname.value + "&lastname=" + lastname.value  + "&company=" + company.value             
    + "&myemail=" + myemail.value
+ "&address=" + address.value
+ "&city=" + city.value
+ "&province=" + province.value
+ "&postalcode=" + postalcode.value
+ "&country=" + country.value
+ "&contact=" + contact.value
+ "&radio1=" + radio1.value
+ "&paymentmethod=" + paymentmethod.value
);

}

code for html form for radio buttons is

<input type="radio" name="radio1" id="radio1" value="Free Shipping"  onclick="emp1();"> Free Shipping<br />  
<input type="radio" name="paymentmethod" id="paymentmethod"  value="abc"  onclick="emp1();">abc
<br />
<input type="radio" name="paymentmethod" id="paymentmethod" value="def"  onclick="emp1();" onchange="emp1();">def
<br /> 
 <input type="radio" name="paymentmethod" id="paymentmethod" value="ghi"  onclick="emp1();">ghi

Any help … ..
thnx in advance

  • 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-18T10:40:29+00:00Added an answer on June 18, 2026 at 10:40 am

    You can use something like this to get selected radio button vlaue using javascript inside your emp1() function. it will give you selected radio button value.

    var inputs = document.getElementsByName("paymentmethod");
        for (var i = 0; i < inputs.length; i++) {
          if (inputs[i].checked) {
            var paymentmethod = inputs[i].value;
          }
        }
    
        alert(paymentmethod);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a form validation using ajax post method. But i got the
On my website, I have a poll. It's cookie based poll. If a user
I am working on an .NET MVC 3 project where I have made all
I have a PartialView, on a form that does an ajax post. All my
I Have a working PHP Based Pagination onto which i am adding ajax to
i have a form (made through codeigniter) that i want to submit with ajax
I have made a simple chat application in PHP/Ajax/MySQL. I am regularly calling these
I have made a simple code for ajax to call a page but it
Possible Duplicate: return AJAX callback return I have made a JQuery code using AJAX,
The commandlink link2 does not have work after an ajax call is made to

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.