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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:12:02+00:00 2026-06-15T01:12:02+00:00

I have a form with two radio buttons. One button id’d as ‘trigger_unit’, the

  • 0

I have a form with two radio buttons. One button id’d as ‘trigger_unit’, the other as ‘normal_unit’. There is also a select drop down with four values and a default NULL value.

<select rel="dropdown" name="trigger_id" id="trigger_id" 
onchange="((this.value != '') ? document.getElementById('trigger_unit').checked=true : 
document.getElementById('normal_unit').checked=true;)" style="width: 120px;">
<option value="" selected="selected">--none--</option>
<option value="1">Critical</option>
<option value="2">Draw</option>
<option value="4">Heal</option>
<option value="3">Stand</option>
</select>

What’s supposed to happen is the javascript is supposed to change the value of the radio button if there is a non-blank value from the drop down. I tried to follow the in-line IF example here but it’s not exactly working. Can this be done or do I HAVE to write a second function?

  • 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-15T01:12:04+00:00Added an answer on June 15, 2026 at 1:12 am

    Looks like you have an errant ; in your code…

    This fiddle works: http://jsfiddle.net/bxLfu/

    The code is the same as yours, but without the ;:

    <select rel="dropdown" name="trigger_id" id="trigger_id" 
    onchange="((this.value != '') ? document.getElementById('trigger_unit').checked=true : 
    document.getElementById('normal_unit').checked=true)" style="width: 120px;">
    <option value="" selected="selected">--none--</option>
    <option value="1">Critical</option>
    <option value="2">Draw</option>
    <option value="4">Heal</option>
    <option value="3">Stand</option>
    </select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two groups of radio buttons set up in one form: <li>1&nbsp;<Input type
I have two radio buttons what I want is that when I select one
I have two radio buttons on my MVC form that I use to hide
I have a form with two combo boxes and couple of buttons. One of
I have a form with two text boxes, one select drop down and one
I have an Ajax based form with 3 radio buttons. When one is checked,
I have a contact form with two radio buttons. But I need to show
I have two radio buttons, and depending on which one is selected I want
I have a form which contains a 'gender' label and two radio buttons'male' and
My small windows form application has two radio buttons, and initially neither is checked.

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.