-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSriya_11-9-2020.txt
66 lines (55 loc) · 1.42 KB
/
Sriya_11-9-2020.txt
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
Task1:Designation validity
//formValidationUsingJS.html
<!DOCTYPE html>
<head>
<title>
Form Validation Using JS
</title>
</head>
<body>
<script src="js/validation.js"></script>
<form name="form1" method="POST" onsubmit="return jfun1()" action="test.html">
Name: <input type="text" name="t1">
Designation: <input type="text" name="t2">
<input type="submit">
</form>
</body>
//validation.js
function jfun1()
{
var name=form1.t1.value;
var designation=form1.t2.value;
if((name=="")||(designation==""))
{
if(name=="")
{
alert("Please Enter name");
form1.t1.focus();
return false;
}
else if(designation=="")
{
alert("Please Enter designation");
form1.t2.focus();
return false;
}
}
else
{
return true;
}
}
//test.html
<h1>Welcome to Java Script</h1>
Task:2(Database Creation )
show dbs
db
use smdb
db
db.createCollection("Profile")
db.Profile.insert( { uid: 1,name:"Sriya",designation:"developer",location:"India"},{ uid: 2,name:"Moni",designation:"developer",location:"India"} );
db.createCollection("Registration")
db.Registration.insert( { regno: 1,name:"DevOps",course:"MongoDB",fees:1000},{regno: 2,name:"DevOps",course:"Python",fees:5000} );
show tables
show dbs
show collections