0% found this document useful (0 votes)
3 views7 pages

Adobe Scan 10-Dec-2024

The document contains various HTML and JavaScript code snippets for creating a slideshow, a dropdown menu for website redirection, linking banner advertisements to URLs, and implementing a floating menu. It also includes examples of evaluating checkbox selections and validating input formats such as email, Aadhaar card, and phone numbers using regular expressions. Overall, it serves as a guide for client-side scripting techniques in web development.

Uploaded by

giteanuja09
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)
3 views7 pages

Adobe Scan 10-Dec-2024

The document contains various HTML and JavaScript code snippets for creating a slideshow, a dropdown menu for website redirection, linking banner advertisements to URLs, and implementing a floating menu. It also includes examples of evaluating checkbox selections and validating input formats such as email, Aadhaar card, and phone numbers using regular expressions. Overall, it serves as a guide for client-side scripting techniques in web development.

Uploaded by

giteanuja09
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/ 7

Create a slideshow with the group of three images, also simulate next and

previous transition between slides in your Java Script.


ns <html>
<head>
<script>
pics =new Array('jpg'. "2.jpg,"3.jpg')
count 0:
function slideshow(status)
if (document. images)

Count = count + status:


if (count >(pics. length - 1))
count 0;

if (count <0)
count = pics.length- 1;

documet. imagl .src = pics[count);

<0script>
</head>
<body>
<img src="1.jpg" width="200" name="imgl">
<br>
<input type="button" value-"Next" onclick="slideshow( 1y">
<input type="button" value="Back" onclick="slideshow(-1y">
<body>
<html>
Write a javascript to crente a pll-down menu with three options
|Google,
USBTE. Tahoo] once the user will select one of the options then user will be
redirected to that site.
<htm>
head
itle>HTML Fom<itle>
seript language="javascript" type="text/javascr1pt">
function getPage(choice)
page-cho ice.options|choice. selectedindex]. value.
if( page = "")

window.location=page.
Cscript>
</head>
<body>
<form name="myform" act ion="" method="post">
Select Your Favourite Website:
<select name="MenuCho ice" onchange="getPage(this)">
<option
value="htups//www.google.com">Google</opt ion>
<option
value="https://www.msbte.org. in">MSBTE</option>
<option
value="https://www.yahoo.com">Yahoo</option>
</form>
</body>
</html>
Describchow to link banner advertisement to URL with example.
The banner advertisement is the hallmark of every commercial web page. It is typicaly
positoned near the top of the web page, and its purpose is to get the visitor's attention by
doing all sorts of clever things.
loget additionalinformation, the visitor is cxpected to click the banncr so that a new web
page opcns. You can link a banner advertisement to a web page by inserting a hyperlink
into your web page that calls a JavaScript function rather than the URL ofa wcb page. The
JavaScriptthen determines the URL that is associated with the current banncr and loads the
web page that is associaled with the URL.

Example:
<html>
<head>
<title>Link Banner Ads</title
<script language-"Javascript" type-"text/javascript">
Banners new Array'1.jpg.2.jpg3.jpg')
BannerLink = new Anray
'google.com".vpt.cdu.in', 'msbte.org. in/"):
CurrentBanner = 0:
NumO1Banners =Banners.length:
function LinkBanner()

document.location. href =
"http:f/www." + BannerLink(Current Bannerl:
function DisplayBanners()
if(document.images){
CurrentBannert+
if(Current Banner == NumOfBanners)
CurrentBanner =0

document.RotateBanner.src= Banners(Current Bannerl


setTimeout("DisplayBanncrs()", 1000)

<script>
<head>
<body onkoad="DisplayBanners()" >
<center
<a href="javascript: LinkBanner()><imgsrc="Lipg"
Floating Menu
Floating menus stay in a fixed position when you scrollthe page. They appear to "fNloat" on top of
the page as you scroll.
The menu below an example of a floating menu. As you scroll down the page/(frame), the menu
stays fixed in the same position on the page.
To create floating menu , we need toadd style attribute with value position:fixed.
<html>
<head>
<script>
function f1)

var sl= document.getElementByld("s1 ");


if(s 1.value=="")

alert("Please Select a subject")


else

document.getElementByld("p1").innerHTML="Selected subject:" +sl.value;

</script>
</head>
<body>

<br><br<br><br><br><br>
<hl>Floating Menu</h1>
<select name="s" id="s1"onchange="f10" style="position: fixed;">
<option value=""> Select Subjects/option>
<option value="0SY">OSY</option>
<option value="AJP">AJP</option>
<option value="STE">STE</option>
<OPtion value="CSS">CSS</OPtion>
</select>
<br><b» <p id="p1"> </p><br><br><br><br>cbr>cbr>cbrpsbr>

Clhent Side Scripting (Unit 6)


Arrow Computer Academy
Evaluating Checkbox Selection
<html>
<head>
<title>Evaluating Checkboxes</title>
<h3>Select the subjects</h3>
<script language="]avascript" type="text/javascript">
function show)

var x='You Selected


with (document.forms.frm1)

if (a.checked == true)

X+=a.value +

if (b.checked == true)

x+=b.value +

if (c.checked == true)
{
xX+=C.value +
}
if (d.checked == true)
X+=d.value +""

if (e.checked == true)
{
X+=e.value +

document.write(x)

</script>
</head>
<body>
<form name="frm 1" action="" method="post">
<P>
<input type="checkbox" name="a" value="PIC">C
<br>
<input type="checkbox" name="b" value="C++">C++
<br>
<input type="checkbox" name="c" value="java">JAVA
<br>
<inputtype="checkbox" name="d" value-"php'">PHP
<br>
<input type="checkbox" name="e" value="jscript">JAVASCRIPT
<br><br>
<input type="reset" name="r1" value="Show" onclick="show(0">
ArrowComouterA
Client Side Scripting (Unit 3)
(ABle
(ts0AEC.17001 " 2013 C'rtlned)

address,
)lalldatlon ofemall

Valldatlon of adhaar card. Format Is


U)
dddd -dddd - dddd
number. Format is
(U) Valldetlon ef phone
(ddd) dddddddd)
expresslon for Valldallon ofemall addresee
Ans) Regular
Any va
ar alidRegex regex
a-zA-Z0-9.1MSe&zZA-Z0-9-J+(?:A(4-2A-Z0- cmal
0.]-)°$:
Any val
regex
) Validation of adhaar card Format is sdhaar ca
dddd dddd -dddd 2M

Regular expression for Validation of adhaar card Any vali


r2-9)41)[0-9){3)\G[0-9]4}[0-9){4)S/gm regex for
phone no-2:

D) Validation of phone number. Format is


(ddd) <dddddddd)
Regular expression for Validation of phonc number:
var re=]?0[0-9R3)DI?[-sLJ7[0-9](3)(-sLJ7[0-9{4,6) Slim;s
Jovo ssool Program Seorch far charoctr
Lo in lhe beqioing ol cGrd in the
phrese Look AI yo

<body Z
<btn sncicle" my honc iansbyit<lbullo?
<Schp>
Kunckon myhun chon
shi HElLO L0o k AT YoUx"

VoY resull : sh match (ott2)


Jocument u e (aresult)
</sc pt

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy