Jquery change and submit

Am I wrong or something? Trying to make it work with $.post() but nothing happens. even with a simple alert I get nothing. Any ideas?

$("document").ready(function(){
$(".browse").change(function(){
                          $('#form').submit(function(e){
              alert( "Yipee" );
                          preventDefault();
              });
    });
});

Note that

    $(".browse").change(function(){$('#form').submit();});

Is working fine

Answers


place the submit event handler outside

 $(".browse").change(function () {

        });
        $('#form').submit(function (e) {
            alert("Yipee");
            preventDefault();
        });

if you want to trigger the submit you shoul call like this

$(".browse").change(function () {
$('#form').trigger("submit");
        });

Need Your Help

Forwarding requests UDPSocket

ruby network-programming dns udp eventmachine

I have a basic ruby program, that listens on a port (53), receives the data and then sends to another location (Google DNS server - 8.8.8.8). The responses are not going back to their original

Minimum payload for push notification?

ios windows-phone-7 blackberry apple-push-notifications android-c2dm

Is there a minimum payload size for the push notification service for the various mobile platforms like Android, iOS, Blackberry and Windows Phone 7?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.