Ticket #4544: uibug.html

File uibug.html, 1.4 KB (added by BigBadaboom, 10 years ago)
Line 
1<!DOCTYPE html>
2<head>
3<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" />
4<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
5<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js" type="text/javascript"></script>
6
7<script type="text/javascript">
8
9$(document).ready(function () {
10  $("#dialog").dialog({ resizable: false,
11                        draggable: false,
12                        height:140,
13                        modal: true,
14                        autoOpen: false,
15                        overlay: { backgroundColor: '#000', opacity: 0.5 },
16                        buttons: {'Confirm': function() { $("#testform").submit(); },     // Submit form when 'confirm' clicked
17                                  'Cancel': function() { $(this).dialog('close'); } } });
18
19  // intercept submit button click and open dialog instead
20  $("#formsubmit").bind("click", formSubmitClick);
21
22});
23
24
25function formSubmitClick()
26{
27  $("#dialog").dialog('open');
28  return false;
29}
30
31</script>
32</head>
33
34<body>
35
36<div id="dialog" title="Confirm?">
37  <p>Really submit the form?</p>
38</div>
39
40<form id="testform" action="http://www.google.com/search" method="get">
41  <input type="text" name="q" value="" />
42  <input id="formsubmit" type="submit" name="submit" value="Google Search" />
43 </form>
44
45
46</body>
47</html>