-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclassinsert.html
More file actions
50 lines (42 loc) · 1.21 KB
/
classinsert.html
File metadata and controls
50 lines (42 loc) · 1.21 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
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<form>
<label>Enter name</label>
<input class="form-control" type="text" name="class_name" id="class_name"><br>
<button type="button" id="btn"> submit</button>
</form>
<script type="text/javascript">
$(function(){
alert('JavaScript is getting called')
$('#btn').click(function(){
alert('window is getting called')
var a=document.getElementById('class_name').value;
alert(a)
$.ajax({
url:'classcon.php',
type:'post',
data:{
"class_name":a
},
success:function(){
alert('row succesfully added')
},
error:function(){
alert('something is wrong')
}
})
})
})
</script>
</body>
</html>