Thanks Ricardo. Excellent, that did the trick. Can I ask you one more thing?
1. Before I put all the code into a plugin, I used to have it like this: $("#checkoutForm form").livequery(function() { $(this).ajaxForm(options); }); 2. Now with the plugin I bind it this way: $("#checkoutForm).myplugin(); And inside the plugin I triedL $this.find('form').livequery(function() { $(this).ajaxForm(options); }); 3. This doesn't seem to have the same effect as expected. I'm pretty sure I missed something, I just cant find out Regards Raine Inside the plugin I try this: $this = this; $this.livequery(function() { $this.ajaxForm(options); }); On Jan 6, 10:08 am, Ricardo Tomasi <ricardob...@gmail.com> wrote: > Not sure that this is it, but > > $.fn.myplugin = function(options) { > return this.find('form').ajaxForm(); > > }); > > ? > > On Jan 6, 1:59 pm, yellow1912 <yellow1...@gmail.com> wrote: > > > Hi all, I have a question regarding jquery object: > > > if I bind my plugin like this: > > > $('#myButton').myplugin(); > > > And inside my plugin, I want to bind ajaxForm listener to all forms > > inside 'this' current element, what is the best way to do it? I can > > get the id by using $this.attr('id'), but there is no guarantee that > > the users will always pass in an id. > > > (function($) { > > // > > // plugin definition > > // > > > $.fn.myplugin = function(options) { > > // bind ajax form to 'this' > > > }}); > > > Thank you for your help and suggestions > > > Raine