Skip to main content

Search and Top Navigation

Ticket #4544: uibug.html


File uibug.html, 1.4 KB (added by BigBadaboom, May 20, 2009 06:23PM UTC)
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/ui-lightness/jquery-ui.css" type="text/css" media="screen" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js" type="text/javascript"></script>

<script type="text/javascript">

$(document).ready(function () {
  $("#dialog").dialog({	resizable: false,
			draggable: false,
			height:140,
			modal: true,
                        autoOpen: false,
			overlay: { backgroundColor: '#000', opacity: 0.5 },
			buttons: {'Confirm': function() { $("#testform").submit(); },     // Submit form when 'confirm' clicked
				  'Cancel': function() { $(this).dialog('close'); } } });

  // intercept submit button click and open dialog instead
  $("#formsubmit").bind("click", formSubmitClick);

});


function formSubmitClick()
{
  $("#dialog").dialog('open');
  return false;
}

</script>
</head>

<body>

<div id="dialog" title="Confirm?">
  <p>Really submit the form?</p>
</div>

<form id="testform" action="http://www.google.com/search" method="get">
  <input type="text" name="q" value="" />
  <input id="formsubmit" type="submit" name="submit" value="Google Search" />
 </form>


</body>
</html>

Download in other formats:

Original Format