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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:39:29+00:00 2026-05-26T12:39:29+00:00

There is this code that apears several times in my page: <div> <input type=hidden

  • 0

There is this code that apears several times in my page:

<div>
   <input type="hidden" name="product" id="productF3" value="7">
   <div>
    <input type="radio" name="size" id="size_s" value="3"> small size
   </div>
   <div>
   <input type="radio" name="size" id="size_n" value="4"> regular size
   </div>
</div>

I have a problem getting the selected value, starting from the productF3 element.
Right now I’m using this code to solve my problem:

if($("#productF3").next().children("input[@name=size]:checked").val() != undefined) do something
else if($("#productF3").next().next().children("input[@name=size]:checked").val() != undefined) do something
else alert("Select a size");

But I want a more robust solution, any suggestions?

Thanks!

  • 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-26T12:39:30+00:00Added an answer on May 26, 2026 at 12:39 pm

    Firstly change $("productF3") to $("#productF3"). Secondly why don’t you use

    $("#productF3").parent().find("input[type='radio'][name='size']:checked").val()
    

    to get selected radio value?

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

Sidebar

Related Questions

There is currently this Prototype code that does a PUT: new Ajax.Request(someUrl, { method:
I have this legacy code that I am working with and there is code
Is there an easy way to modify this code so that the target URL
Is there any way to refactor this code so that it can omit unnecessary
I have trouble finding way to correctly refactor this code so that there would
Is there a CSS code that changes this text This is it to this
If there's any open source code that does this already I'm interested in hearing
In a .f file there is code that does this: real Bob, avar ...
Is there a pattern that I could apply to refactor this code? The only
There's some code in our project that looks a bit like this: Private Sub

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.