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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:52:45+00:00 2026-05-27T17:52:45+00:00

I basically have two forms, one for Male and another for Female. The code

  • 0

I basically have two forms, one for Male and another for Female.
The code below works for the male form, but when I modify my code to do the same thing for Female page it doesn’t work. I’ve found that if the code for the Male form is first it will work but not for the Female form. And if I put the female code first it will work but the Male form/code wont work. So it works, but I think jqtouch/jquery can’t differentiate between the two groups of radio buttons even when I have change the name of the radio buttons.

$("input[name=AxMale]:radio").click(function() {
    var x;
    x = parseFloat($("#MalePred").val())
    if ($(this).val() == '0') {
        parseFloat($('#prePredMale').val(x));
    }
    else if ($(this).val() == '1') {
        parseFloat($('#postPredMale').val(x));
    }
    else if ($(this).val() == '2') {
        parseFloat($('#MalePred').val(''));
        parseFloat($('#cmMale').val(''));
        parseFloat($('#kgMale').val(''));
        parseFloat($('#ageMale').val(''));
        $(this).attr('checked', false);

    }

});
return false;

this is the html

<li><input type="radio" name="AxMale" value="0" title="Initial Assessment" /></li>
 <li><input type="radio" name="AxMale" value="1" title="Exit Assessment" /></li>
<li><input type="radio" name="AxMale" value="2" title="Do Another Calculation" /></li>

if also tried the solutions on this link JQuery and multiple radio button groups problem

$("input:radio").click(function() {
  if (this.name == "group_1") {
    // group 1 clicked
  } else if (this.name == "group_2") {
    // group 2 clicked
  }
});

but no success, any help would be great.


just to be more specific:

when i have this code for the female form…

$("input[name=AxFemale]:radio").click(function() {
    var x;
    x = parseFloat($("#FemalePred").val())
if($(this).val() == '0') 
{
parseFloat($('#prePredFemale').val(x));
}
else if($(this).val() == '1')
{
parseFloat($('#postPredFemale').val(x));
}
else if($(this).val() == '2')
{
parseFloat($('#FemalePred').val(''));
parseFloat($('#cmFemale').val(''));
parseFloat($('#kgFemale').val(''));
parseFloat($('#ageFemale').val(''));
$(this).attr('checked', false);

}

});
return false;

this works…but only when it is placed before the male code.

so on the same html (because I am using jqtouch) i have a group of radio buttons named AxFemale

<li><input type="radio" name="AxFemale" value="0" title="Initial Assessment" /></li>
 <li><input type="radio" name="AxFemale" value="1" title="Exit Assessment" /></li>
 <li><input type="radio" name="AxFemale" value="2" title="Do Another Calculation" /></li>
  • 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-05-27T17:52:46+00:00Added an answer on May 27, 2026 at 5:52 pm

    Try

    $("input:radio").click(function() {
      if ($(this).attr('name') == "group_1") {
        // group 1 clicked
      } else if ($(this).attr('name') == "group_2") {
        // group 2 clicked
      }
    });
    

    Update

    Just as notice: In your HTML example the there is only a group with name “AxMale”

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

Sidebar

Related Questions

I have two web pages which work basically the same, code-wise, but one of
I have found many people with simliar issues but no soultions...basically I have two
I have a web site with two routes. Basically the user can do one
I have a helper function, which basically calls CompareTo on two objects, but does
I have two pages one is the main page and the another one is
I have some code that does custom drawing. Basically it is form fill program
I have this code. Trying to pass form values from one internal page to
I am having an issue where I have two forms on the one page
Basically when I have more than about 25 file uploads in one form, the
If I were to select a row from a table I basically have two

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.