jquery form submit problem
<p>in some reason if I use this code it sends the form in normal way not with jquery? What could be the problem? thanks</p>

<pre><code>&lt;script&gt;
        $(document).ready(function(){
            $("form#formi").submit(function() {
                    $(":text, textarea").each(function() {
                        if($(this).val() === ""){
                        $('p#error').fadeIn(1000);
                        var tyhjia=true;
                        }
                    });

                    if(tyhjia == true){
                    // tyhjia on , joten ei jatketa
                    } else {
                        // we want to store the values from the form input box, then send via ajax below
                        var fname     = $('#name').attr('value');
                        var lname     = $('#email').attr('value');
                            $.ajax({
                                type: "POST",
                                url: "laheta-viesti",
                                data: "name="+ fname +"&amp; email="+ lname,
                                success: function(){
                                    $('form#formi').hide();
                                    $('p#valmista').fadeIn(1000);
                                }
                            });
                    }
            return false;
            });
        });
&lt;/script&gt;
</code></pre>
