-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.html
78 lines (70 loc) · 1.78 KB
/
main.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
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
<html>
<head>
</head>
<style>
*{
font-family: Arial, sans-serif;
}
form{
margin: 15px 5px;
width: 500px;
font-size: 16px;
}
form h1{
text-align: center;
}
form label{
display: block;
margin-bottom: 5px;
}
form input, form textarea{
width: 100%;
padding: 5px;
margin-bottom: 10px;
box-sizing: border-box;
resize: vertical;
}
form button{
background: #4CAF50;
color: white;
padding: 10px 15px;
margin-top: 5px;
border: none;
cursor: pointer;
}
form button:hover{
background: green;
}
</style>
<body>
<form>
<h1>Send Data To WhatsApp</h1>
<label for="">Name</label>
<input type="text" class="name">
<label for="">Email</label>
<input type="text" class="email">
<label for="">Country</label>
<input type="text" class="country">
<label for="">Message</label>
<textarea class="message"></textarea>
<button type="button" onclick="sendwhatsapp();">Send Via WhatsApp</button>
</form>
<script>
function sendwhatsapp(){
var phonenumber = "+919509712813";
var name = document.querySelector(".name").value;
var email = document.querySelector(".email").value;
var country = document.querySelector(".country").value;
var message = document.querySelector(".message").value;
var url = "https://wa.me/" + phonenumber + "?text="
+"*Name :* "+name+"%0a"
+"*Email :* "+email+"%0a"
+"*Country:* "+country+"%0a"
+"*Message :* "+message
+"%0a%0a"
+"This is an example of send HTML form data to WhatsApp";
window.open(url, '_blank').focus();
}
</script>
</body>
</html>