How to display jQuery UI dialog in submit button's onclick and prevent form submission? I'm using Drupal 7 and jQuery Update module set to jQuery version 1.8. I have a form. In it's definition I have:

$form['#attached']['library'] = array(
  array('system', 'ui.dialog'),
  array('aat_pc_product', 'product_form'),
);


In the behavior, I use:

if(!isFormValid) {
  $('&lt;div&gt;' + Drupal.t('Some fields was left blank even when not disabled. Either check "skip line" or fill missing data.') + '&lt;/div&gt;').dialog({ modal: true });
}

return isFormValid;


Now, with good old alert it worked great. But when I try do use dialog, in chrome in my console I get:


  Uncaught TypeError: Object function (a,b){return new p.fn.init(a,b,c)} has no method 'curCSS' jquery.ui.position.min.js?v=1.8.7:13


In FireFox it fails in similar way:


  TypeError: c.curCSS is not a function
  ...his,"marginTop",true))||0,v=l+p+parseInt(c.curCSS(this,"marginRight",true))||0,w...
  jquery...v=1.8.7 (row 13) 


Updating to dev version of jQuery Update and seelcting jQuery 1.9 or 1.10 does not help - it does not complain about curCSS, but about lack of $.browser() that was removed in jQuery 1.9, and deprecated long ago.

My question is: Am I doing something wrong, or it's a bug between jQuery Update and Drupal? And if it's a bug, is there any version of jQuery update without it?

Is there a way to update jQuery UI to make it match jQuery, without hacking jQuery Update module or updating directly in D:\UniServer\www\misc\ui ?
when c.curCSS is not a function error occures ,just do the following
if any two js included check and remove .. after add this into script

jQuery.curCSS = jQuery.css;