-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap_tooltip.php
More file actions
78 lines (74 loc) · 1.68 KB
/
bootstrap_tooltip.php
File metadata and controls
78 lines (74 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<script>
$(function ()
{
$('[data-toggle="tooltip"]').tooltip();
$("#txtremark").keyup(function ()
{
$("#txtremark").val() != "";
setTimeout(function ()
{
$("#txtremark").tooltip('hide');
}, 1500);
});
$('#txtremark').on('blur', function ()
{
setTimeout(function (){
if ($("#txtremark").attr('aria-describedby'))
$("#txtremark").tooltip('hide');
}, 500);
});
$('#submitBtn').on('mousedown', function (e)
{
e.preventDefault();
});
$('#submitBtn').on('click', function ()
{
if ($("#txtremark").val() === "")
{
if (!$("#txtremark").attr('aria-describedby'))
$("#txtremark").tooltip('show');
$("#txtremark").focus();
return false;
}
var $btn = $(this).button('loading');
$("#cancelBtn").prop('disabled', true);
// business logic...
$.ajax({
url: "product_addremark.php",
method: "POST",
data: {
remark: $("#txtremark").val(),
productID: $("#product").val(),
supplier: $("#supplier").val()
}
})
.done(function(data)
{
if (data == true)
{
setTimeout(
function ()
{
$('#submitBtn').text('E-mail sent');
}, 2000
);
setTimeout(
function ()
{
$('#editGroupNameModal').modal('hide');
$("#txtremark").val("");
$('#submitBtn').button('reset');
$('#cancelBtn').prop('disabled', false);
}, 5000
);
}
if (data == false)
{
alert("ERROR. Code 0x00012.");
$('#submitBtn').button('reset');
$('#cancelBtn').prop('disabled', false);
}
});
})
})
</script>