jquery表单在jquery对话框ui之前提交

i have this openid plugin but when i click on aol the dialog opens and within no time it automatically gets closed and the form is submitted. i want that it shud stop at time when dialog opens and form shud be submitted only when i close the dialog box

please help me out

(function($){
  $.fn.openid = function() {
    $('input').click(function(e){
      var provider = $(this).attr('class');
     if (provider == 'aol') {
        $("#dialog").dialog();  
         }
     else{
      var provider_url = $(this).attr('id');  //get id
      var myinput = $('<input type="hidden" name="provider_url"/>').val(provider_url);
        }  
        $('form').append(myinput);
      $('form').submit();
    })
  }
})(jQuery);

even e.stopPropogation(); to the click event handler is not working even if i put form.submit (return false ) in if loop it disable form completely for else loop also

Have you tried adding

e.preventDefault();

at the beginning of your click function?

I think the problem is occurring thanks to this peace of code:

$('form').submit();

The peace of code sits on its own and therefore will get executed whenever $('input') is clicked. What you should try is putting that peace of code in another jQuery click function or put it inside an if of else statement.

$('.buttonX').click(function()
{
   $('form').submit();
});