jquery form with dialog ( issue with the if else loop in jquery)

Hi have a form to submit with the help of jquery plugin "openid".now every thing works fine when i click on google_button but when i click on aol it will open dialog and will submit the form (when form.submit with return false is commented out) . when i remove the comments the aol will work fine with only aol dialog getting open and form not getting submitted but google form will also will not be submitted in that case.

Please help me out

================================================================================

<form action="example.php" method="post" >   
<input type="image" src="images/google_button.png" id='https://www.google.com/accounts/o8/id' class="google"/> 
          <input type="image" src="images/AOL_button.png" id='http://openid.aol.com/' class='aol' />
</form>

================================================================================

 <script type="text/javascript">  
      $(document).ready(function(){
        $('form').openid(); 
      })
    </script>

================================================================================

(function($){
  $.fn.openid = function() {
    $('input').click(function(e){
      var provider = $(this).attr('class');
     if (provider == 'aol') {
        $("#dialog").dialog();
         /*$('form').submit(function(){
             return false;   
    })*/
     }
     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);

===============================================================================

Answers


Try to send the form after if else construction.


(function($){
  $.fn.openid = function() {
    $('input').click(function(e){
      var provider = $(this).attr('class');
     if (provider == 'aol') {
        $("#dialog").dialog();
         /*$('form').submit(function(){
             return false;   
    })*/
  ***return false;***   //add return false in this section
     }
     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);

Need Your Help

Get warning : re-installation failed due to different application signatures when update version application

android apk digital-signature code-signing

on my device installed my app from play store, but I Get warning : re-installation failed due to different application signatures when update new version application from eclipse.

Strange effect with Scrolltop on Chrome/Safari

jquery google-chrome safari scrolltop

When i'm on Chrome or Safari, and i click the second button (.scroll2), it make like a reload to the top fast effect and then goes where it supposed to. Any way to stop this effect ?