wukele / jpolite

Automatically exported from code.google.com/p/jpolite
0 stars 1 forks source link

improvement proposal #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I propose changing in jquery.myext.js this code

                $('input.submit',this).click(function(){
                        $.post(x.action, $(x).serialize(), function(data)
                        {result.html(data);prepModule.apply(result[0]);});
                        return true;

into this code

                $('input[type="submit"]',this).click(function(){
                        $.post(x.action, $(x).serialize(), function(data)
                        {result.html(data);prepModule.apply(result[0]);});
                        return false;

Or if not changing it, adding to it.

The current way only works for forms that have a <input type='button'
class='submit'> button.
In the proposed way it will work for all forms that have a <input
type='submit'> button.

Original issue reported on code.google.com by massimod...@gmail.com on 20 May 2009 at 3:52

GoogleCodeExporter commented 9 years ago
You're right, that's actually kinda weird design :)
I've revised the implementation, i.e., $(form).submit(function(){ $.post .... })

So that either you click a button with type=submit or simply press ENTER, 
$.post will
be called.

Check out the latest code for more :)

Original comment by bwstud...@gmail.com on 6 Jun 2009 at 1:05