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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:10:23+00:00 2026-06-17T23:10:23+00:00

guys I tried a lot for this code but nothing come up for conversion

  • 0

guys I tried a lot for this code but nothing come up for conversion from javascript to jquery..

This code is irrelevant cuz u find this in working fiddle.. I added this chunk of code cuz stackoverflow dont allow me to post without a code..

<div class="rButtons">
<input type="radio" name="numbers" value="10" onclick="uncheck();" />10
<input type="radio" name="numbers" value="20"  onclick="uncheck();" />20
<input type="radio" name="numbers" value="other" onclick="check(this);"/>other
<input type="text" id="other_field" name="other_field" onblur="checktext(this);"/>
</div>

Check this fiddle

http://jsfiddle.net/gDxqj/

It is working well. on clicking “other” radio button the text field comes up and on clicking any other radio button it disappears.. This is the function of this script and it is working well..

Now when i tried changing it to jquery code it died.. I can show what code i made in jquery but to no help..

Fiddle for the same will help a lot..

Thanks in advance..

This is what i did

<script>
var $radios = $('input:radio[name=numbers]');
    if ($radios.is(':checked') === true) {
       $("#other_field").show();
    }     
    else
    {
       $("#other_field").hide();
    }   
</script>

I put it put that in a function and invoke it in “onchange” of radiobutton but not worked

  • 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-17T23:10:24+00:00Added an answer on June 17, 2026 at 11:10 pm
    $(':radio').on('change', function () {
      $('#other_field')[$(this).val() === 'other' ? 'show' : 'hide']();
    });
    
    $('#other_field').on('blur', function () {
      var val = $(this).val();
    
      if(isNaN(val)) {
        alert('only numbers are allowed..');
      }
      else if(parseInt(val, 10) % 10 > 0) {
        alert('only multiples of 10..');
      }
    });
    

    with:

    <div class="rButtons">
      <input type="radio" name="numbers" value="10" /> 10
      <input type="radio" name="numbers" value="20" /> 20
      <input type="radio" name="numbers" value="other" />other
      <input type="text" id="other_field" name="other_field" />
    </div>
    

    demo: http://jsfiddle.net/BZGsw/

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

Sidebar

Related Questions

Guys, I have tried a lot but I didnt find it. I will appreciate
HI guys, my application uses a lot of different javascript files. SO I tried
So guys I tried a commit on our server and end up in this
This might be easy for you guys but i could't get it. I have
I have searched a lot about this topic and I can't get this code
I made a lot of search on this topic but all goes in vain.
Guys, I HAVE tried reading tons of stuff about EJB. And I don't get
guys, I would like to you evaluate next code below. As you see, I
Guys, I've came across this problem I can't resolve myselg, I'm pretty sure I
So I've developed this Access 2007 application with about 2 forms, a lot of

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.