-
Notifications
You must be signed in to change notification settings - Fork 0
/
click2call.html
49 lines (42 loc) · 1.38 KB
/
click2call.html
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
<html>
<head>
<title>Click to Call</title>
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<script src="https://www.google.com/recaptcha/api.js?render=6Lf0GLBZAAAAAJFykfGdZcRRfpM5FipMC6fCYfrf"></script>
</head>
<body>
<div>
<b>Enter your Number</b>
</div>
<form id="ccForm" action="click2call.php" method="post">
<div>
<div>
<!--change phone number pattern if you need-->
<input type="tel" id="phone" name="phone"
pattern="[0-9]{10}"
required>
<small>Format: 0123456789</small>
</div>
<div>
<input type="submit" value="submit">
</div>
</div>
</form>
<script>
$('#ccForm').submit(function(event) {
event.preventDefault();
var phone = $('#phone').val();
grecaptcha.ready(function() {
grecaptcha.execute('6Lf0GLBZAAAAAJFykfGdZcRRfpM5FipMC6fCYfrf', {action: 'cc_send'}).then(function(token) {
$('#ccForm').prepend('<input type="hidden" name="token" value="' + token + '">');
$('#ccForm').prepend('<input type="hidden" name="action" value="cc_send">');
$('#ccForm').unbind('submit').submit();
});;
});
});
</script>
</body>
</html>