Re: [jQuery] Bind event to radio button group

2007-03-03 Thread Klaus Hartl
Brad Perkins schrieb: Thanks for the tip. That looks promising. Brad If you use load() or $.ajax with the dataType option set to 'html', javascripts will be evaluated. $('#target').load('from/here.php'); $.ajax({ url: 'from/here.php', dataType: 'html' }); For more information

Re: [jQuery] Bind event to radio button group

2007-03-03 Thread Sam Collett
On 03/03/07, Brad Perkins [EMAIL PROTECTED] wrote: Josh, After further testing this doesn't appear to work with IE6 (or Safari). Your technique for binding the radio buttons works in the main page, but it appears that any javascript returned via the ajax call is ignored by IE6 (and also by

Re: [jQuery] Bind event to radio button group

2007-03-02 Thread Josh Nathanson
Try: $(input:[EMAIL PROTECTED]).click(function() { alert('radio button clicked'); }); I ran into the same problem - you have to include the radio selector or it won't work. Also you don't need to use bind, you can directly bind the click function using the syntax above. -- Josh -

Re: [jQuery] Bind event to radio button group

2007-03-02 Thread Sean O
Brad, Looks like you need to use the .each function to iterate through each radio button. Here's some demo code: http://www.bennadel.com/blog/534-The-Beauty-Of-The-jQuery-Each-Method.htm Docs: http://jquery.bassistance.de/api-browser/#eachFunction SEAN O http://www.sean-o.com/

Re: [jQuery] Bind event to radio button group

2007-03-02 Thread Sean O
Code for your example (just tested): $([EMAIL PROTECTED]).each( // For each button, run this code. The i is the loop iteration index on the current element function( i ){ // Bind the onclick event to alert the iteration index

Re: [jQuery] Bind event to radio button group

2007-03-02 Thread Brad Perkins
Josh and Sean, Thanks for the help. Both solutions appear to work. Part of my problem was that I was initially performing the bind in $(document).ready(...). At first neither of your suggestions worked. Then I realized that the radio buttons I want to bind to are in a table that appear in the

Re: [jQuery] Bind event to radio button group

2007-03-02 Thread Josh Nathanson
If I return your examples with the AJAX content the bind works. Is there a better way to do that? AFAIK that's the only way to do it, if your radio buttons only appear after an AJAX call. But, I am a noob myself, so don't take my word for it! -- Josh

Re: [jQuery] Bind event to radio button group

2007-03-02 Thread Brad Perkins
Josh, After further testing this doesn't appear to work with IE6 (or Safari). Your technique for binding the radio buttons works in the main page, but it appears that any javascript returned via the ajax call is ignored by IE6 (and also by Safari). BTW, my AJAX stuff is really AJAH (returning

Re: [jQuery] Bind event to radio button group

2007-03-02 Thread Josh Nathanson
soundly asleep. ;0) -- Josh - Original Message - From: Brad Perkins [EMAIL PROTECTED] To: jQuery Discussion. discuss@jquery.com Sent: Friday, March 02, 2007 4:02 PM Subject: Re: [jQuery] Bind event to radio button group Josh, After further testing this doesn't appear to work with IE6

Re: [jQuery] Bind event to radio button group

2007-03-02 Thread Daemach
You can do this with the taconite plugin, which allows you to pass HTML back from the server and insert it into another element on the page. After you've done all your updates, if you include an eval block at the end you can put your script there rebind everything.

Re: [jQuery] Bind event to radio button group

2007-03-02 Thread Brad Perkins
Thanks for the tip. That looks promising. Brad On 3/2/07, Daemach [EMAIL PROTECTED] wrote: You can do this with the taconite plugin, which allows you to pass HTML back from the server and insert it into another element on the page. After you've done all your updates, if you include an eval