On Dec 15, 2:34 pm, kenyabob <andy.skogr...@gmail.com> wrote:
> http://pastebin.com/m6cd05daa
>
> I am trying to call a function and pass parameters regarding the
> button that called the function. This doesn't seem to do it. What am I
> missing?

First thing I see is that you're not passing a function into .click
().  You're passing the result of calling your function, and since
your function doesn't return anything, you're passing nothing at all.

Second, if you don't want the default behavior of the click
(presumably to submit a form), you need to cancel the event.  You can
use event.preventDefault() or simply return false from your function.

So it would help to convert this:

    $("input.Malcolm").click (
        checkAnswer($(this).attr('class'), $(this).parent().parent
().attr('id'))
     );

to this:

    $("input.Malcolm").click (function(event) {
        checkAnswer($(this).attr('class'), $(this).parent().parent
().attr('id'));
        return false;
    });

Cheers,

  -- Scott

Reply via email to