0% found this document useful (0 votes)
9 views4 pages

s21 Paper Solution

K

Uploaded by

qazikarim090
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views4 pages

s21 Paper Solution

K

Uploaded by

qazikarim090
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Telegram | YoutubeChannel :- NewIdeasYT

1. Create a HTML form that accepts two value. Write a program to sum
and multiply of two numbers using JavaScript.
<html>
<head>
<title>Newideasyt Calculator</title>
</head>
<body>
<form>
First Number : <input type="Number" id="a" ><br><br>
Second Number : <input type="Number" id="b" ><br><br>
<button onclick="cal()">Click me</button>
</form>
<script type="text/javascript">
function cal() {
var fn=document.getElementById('a').value;
var sn=document.getElementById('b').value;
var sum=parseInt(fn)+parseInt(sn)
var mul=parseInt(fn)*parseInt(sn);
alert("Sum is = "+ sum + " Multiplication is = "+ mul
);
}
</script>
</body>
</html>

© Copyright | Newideasyt यह PDF WWW.EXAMJILA.COM से डाउनलोड की गयी है |


Telegram | YoutubeChannel :- NewIdeasYT

what do you mean by data validation on a webpage? design


a simple web page with text fields such as name, email id,
phone number, password and a submit button. apply
validation on email, phone number and the password field.
Data validation : Data validation is the process of verifying and validating data that is
collected before it is used. Any type of data handling task, whether it is gathering data, analyzing it,
or structuring it for presentation, must include data validation to ensure accurate results.

<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<h1 style="text-align: center"> Registration Form </h1>
<form name="forms" onsubmit="return ValidationForm()" method="post" >
<pre>
Name: <input type="text" name="name"><br><br>
E-mail id: <input type="text" name="email"><br><br>
Password: <input type="text" name="pass" > <br><br>
Phone No.: <input type="number" name="phone"><br><br>
<input type="submit" value="Send" name="Submit">
</pre>
</form>

<script>
function ValidationForm() {
let email = document.forms.email.value;
let password = document.forms.pass.value;
let phoneNumber = document.forms.phone.value;

if(email == "") {
alert("Please enter a valid e-mail address.");
return false;
}
if(email.indexOf("@", 0) < 0) {
alert("Please enter a valid e-mail address.");
return false;
}
if(email.indexOf(".", 0) < 0) {
alert("Please enter a valid e-mail address.");
return false;
}

if(password == "") {
alert("Please enter password.");
return false;}

if(password.length<6) {
alert("Password Must be minimum 6 char.");
return false;
}

if(phoneNumber== "") {
© Copyright | Newideasyt यह PDF WWW.EXAMJILA.COM से डाउनलोड की गयी है |
Telegram | YoutubeChannel :- NewIdeasYT

alert("Please enter your telephone number.");


return false;
}
return true;
}
</script>
</body>
</html>

© Copyright | Newideasyt यह PDF WWW.EXAMJILA.COM से डाउनलोड की गयी है |


Telegram | YoutubeChannel :- NewIdeasYT

what are the different types of border-style? design a


simple web page with different type of border style and
paragraph written inside the border using CSS.
types of border-style: none (Default value), hidden, dotted, dashed, solid, double, groove, ridge,
inset, outset etc.

<!DOCTYPE html>
<html>
<head>
<title>Border styles</title>
</head>
<body>
<p style=" border:2px dashed darkred;">Paragraph dashed</p>

<p style="border-width: 2px; border-color:green; border-


style:solid ;">Paragraph solid</p>

<p style="border-width: 2px; border-color:navy; border-


style:groove ;">Paragraph groove</p>

<p style="border-width: 2px; border-color:gold; border-


style:inset;">Paragraph inset</p>

<p style="border-width: 2px; border-color:black; border-


style:outset;">Paragraph outset</p>
</body>
</html>

© Copyright | Newideasyt यह PDF WWW.EXAMJILA.COM से डाउनलोड की गयी है |

You might also like