Thanks for the reply Robert. :) Because the "product_id" represents
grouping of radio boxes, I wanted a single click event on the
product_id, then handle the display of the hidden checkboxes
accordingly.

As I thought, I had the name selector wrong.

Instead of using this:
$("product_id").click()

I should have used this:
$("input[name=product_id]").click()

And now it works :)

        $("input[name=product_id]").click(function () { // problem here i
think... im trying to call the input name instead of id?

                if ($("#multimarket").is(':checked')) { // if multimarket radio 
is
selected, unhide the checkboxes

                  $("#market_selection").removeClass("hide");

                } else { // else hide the checkboxes

                  $("#market_selection").addClass("hide");

                }

Should I have done anything differently?


On Sep 30, 12:37 pm, roberto <arriba...@gmail.com> wrote:
> I guess you are assigning the ".checked" class doing something else,
> right?
>
> Did u try this?:
>
> if ($("#multimarket").is(':checked')) {
>
> Into this:
>
> if ($("#multimarket").hasClass(':checked')) {
>
> Also, why you are using this:
>
> $("product_id").click(function () {
>
> Spite this:
>
> $("#checkbox").click(function () {
>
> I mean, calling them by id.
> Or you need to do this on each <input>
>
> Let´s see...
>
> On 30 sep, 16:21, ripcurlksm <kevin.mccorm...@cox.net> wrote:
>
> > I have three radio buttons, and when a certain radio is selected I
> > want to show a series of checkboxes. If the other two radio buttons
> > are selected, I want to hide the checkboxes. I *think* the problem is
> > that I am using the wrong syntax to call the click() function on the
> > radio "name" attribute.
>
> > Example/Code here:http://psylicyde.com/misc/jquery-validate/demo/index3.html
>
> > $("product_id").click(function () {
> >         if ($("#multimarket").is(':checked')) {
> >                 // showcheckboxes
> >         } else {
> >                 // hide checkboxes
> >         }
>
> > });
>
> > <input type="radio" class="checkbox" id="market"               
> > name="product_id"
> > value="1"/>Single Market
> > <input type="radio" class="checkbox" id="multimarket"
> > name="product_id" value="2"/>Multiple Markets
> > <input type="radio" class="checkbox" id="full"                         
> > name="product_id"
> > value="3"/>All Markets

Reply via email to