Hey all,

This is my first post to the community.  I'm a total jQuery n00b, and I'm
struggling with conditional statements & jQuery.  Here's what I'm trying to
do:

The page is a form that uses the same template for both add and edit modes.
On page load, jQuery should detect whether or not a choice from a radio
button selection is checked.  Here is the relevant HTML:

<label for="plan"><input type="radio" id="plan" name="coverage"
value="Healthcare Plan" checked="checked" /> My <strong>healthcare
plan</strong> includes prescription drug benefits.</label>
<label for="medicare"><input type="radio" id="medicare" name="coverage"
value="Medicare Part D or Medicaid" /> I am enrolled in either
<strong>Medicare Part D</strong> or <strong>Medicaid</strong>.</label>
<label for="hsa"><input type="radio" id="hsa" name="coverage" value="Health
Savings Account" /> I have a <strong>Health Savings Account</strong> (HSA)
and otherwise plan to pay retail price.</label>

If the first choice is selected on page load, do nothing.  If the other two
are selected on page load, show/hide certain fields.  I have the show/hide
stuff working, but I'm struggling with the conditional stuff.

I'm trying to do something like ...
if ($("input[id='plan']").attr('checked').is(false)) {
  // show/hide
}
... but, y'know, something that works. ;)

Any help would be much appreciated.

TIA,
NIck

Reply via email to