1

I'm getting syntax error in firebug here is the code :

$('#moderator-attention').live('toogle', function(){                  
             function () {
                $(".moderator-tex").show();
              },
              function () {
                $(".moderator-tex").hide();
              }

             });

I want to create a toogle function, when button is clicked then textarea with class moderator-tex should appear .. and if other button is clicked then should be hidden ..

4 Answers 4

2

Here's the solution: http://api.jquery.com/live/#multiple-events

And the syntax error occurs because you have something like this:

function() {
    function() {

    },
    function() {

    }
}

And this makes no sense.

Sign up to request clarification or add additional context in comments.

1 Comment

What I meant to do is I have multiple radio buttons when one is checked textarea shows.. and if you choose any other it hides
1

Based on your question/comments maybe you ought to try this :

    $("input:radio").click(function() {
        var value = $this("attr", "value");
        if(value == "expected value"){
        $(".moderator-tex").show();
       }else{
       $(".moderator-tex").hide();
       }

    });

You should set some value for this particular radio button to make this work

Comments

0

Try this:

$('#moderator-attention').live('toogle', function(){                  
    $(".moderator-tex").slideToggle();
   }
});

If your textarea is not created on-the-fly, you can even try:

$('#moderator-attention').click(function(){                  
    $(".moderator-tex").slideToggle();
});

1 Comment

What I meant to do is I have multiple radio buttons when one is checked textarea shows.. and if you choose any other it hides
0
$('#moderator-attention').live('toogle', function () {
  $('.moderator-text').toggle();
});

Would be how I would do it.

Not quite sure what you're trying to achieve doing it your way...

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.