Sinhgad Technical Education Society'S: Write A Javascript Code To Create 3 Radio Buttons To Select Country Names
Sinhgad Technical Education Society'S: Write A Javascript Code To Create 3 Radio Buttons To Select Country Names
Sinhgad Technical Education Society'S: Write A Javascript Code To Create 3 Radio Buttons To Select Country Names
MICROPROJECT REPORT
ON
‘Write a JavaScript code to create 3 radio buttons to select Country names-
India, U.S, China and one option list to display name Cities. Based on Country
selection the option list must get changed’
SUBMITTED
BY
Under Guidance of :
Mrs. S.M.Mate
Certificate
This is to certify that Mr. Pawar Aniruddha Prakash with Roll
No. 45 of Fifth Semester of Diploma in Computer Technology
of Institute Sou. Venutai Chavan Polytechnic (Code : 0040) has
successfully completed the Micro-Project in Client Side
Scripting Language (22519) for the academic year 2020-2021.
Certificate
This is to certify that Mr. Ghule Prayush Sopan with Roll No.
45 of Fifth Semester of Diploma in Computer Technology of
Institute Sou. Venutai Chavan Polytechnic (Code : 0040) has
successfully completed the Micro-Project in Client Side
Scripting Language (22519) for the academic year 2020-2021.
Certificate
This is to certify that Mr. Pawar Kunal Shravan with Roll No.
46 of Fifth Semester of Diploma in Computer Technology of
Institute Sou. Venutai Chavan Polytechnic (Code : 0040) has
successfully completed the Micro-Project in Client Side
Scripting Language (22519) for the academic year 2020-2021.
We will focus on the materials we need, as well as the instructions and sort it out in a manner
which will expedite different responsibilities of the team members.
Get information about the Arrays, Functions, & form elements and why they are used.
Develop a code to option list which get changed according to selection of radio buttons.
Test the code and remove errors if any.
Prepare a report on the topic and the developed code.
Annexure II
Micro-Project Report
‘Write a JavaScript code to create 3 radio buttons to select Country names-
India, U.S, China and one option list to display name Cities. Based on Country
selection, the option list must get changed’
1.0 Rationale
A JavaScript used to build interactive web pages and features that are found on many
professional web sites. As a result we want to develop a web page displaying option list and
radio buttons in given problem statement. To achieve desired output we need to use array,
function, form & form elements. Appropriate use of functions and controls results in user
friendly, interactive, and attractive web page.
To create a code that changes option list dynamically according to checkbox selection.
Form elements [Radio Buttons (India, U.S, China), Select] are used to create web page.
When we trigger form events (onclick, onselect) which we have to mention in the element’s
attribute. Events responds according to code return in them. After execution of function we
can see the change in the option list.
Form elements (Radio buttons, Buttons) are used to call the function. An after performing
task on form elements function gets called & user can see the change in the option list with.
SVCP/TYCM Page 7
CSS-(22519) Code that changes option list dynamically on radio button selection
We focused on the materials we needed, as well as the instructions and sorted it out in a
manner which will expedite different responsibilities of the team members.
Gathered information about Arrays, Functions, & form elements and why they are used.
Developed a code to generate a dynamically changing option list.
Tested the code.
Prepared a report.
Checked for any further changes to be done in the project.
Created the final report of the project.
SVCP/TYCM Page 8
CSS-(22519) Code that changes option list dynamically on radio button selection
<form name="f1">
<input type="radio" name="r1" value="Country1" onclick="c(this.value)">India
<input type="radio" name="r1" value="Country2" onclick="c(this.value)">US
<input type="radio" name="r1" value="Country3" onclick="c(this.value)">China
<select name="Cities" size="5">
<option value="1">City1</option>
<option value="2">City2</option>
<option value="3">City3</option>
<option value="4">City4</option>
<option value="5">City5</option>
</select>
</form>
function c(a)
SVCP/TYCM Page 9
CSS-(22519) Code that changes option list dynamically on radio button selection
Code :
<html>
<head>
<script>
function c(a)
{
with(document.forms.f1)
{
if(a =="Country1")
{
Cities[0].text="Delhi"
Cities[0].value=1
Cities[1].text="Mumbai"
Cities[1].value=2
Cities[2].text="Pune"
Cities[2].value=3
Cities[3].text="Kochi"
Cities[3].value=4
Cities[4].text="Manipur"
Cities[4].value=5
}
if(a =="Country2")
{
Cities[0].text="New York"
Cities[0].value=1
Cities[1].text="San Francisco"
Cities[1].value=2
SVCP/TYCM Page 10
CSS-(22519) Code that changes option list dynamically on radio button selection
Cities[2].text="Chicago"
Cities[2].value=3
Cities[3].text="Washington, D.C"
Cities[3].value=4
Cities[4].text="Philadelphia"
Cities[4].value=5
}
if(a =="Country3")
{
Cities[0].text="Beijing"
Cities[0].value=1
Cities[1].text="Shanghai"
Cities[1].value=2
Cities[2].text="Shenzhen"
Cities[2].value=3
Cities[3].text="Wuhan"
Cities[3].value=4
Cities[4].text="Chongqing"
Cities[4].value=5
}
}
}
</script>
</head>
<body>
<form name="f1">
<input type="radio" name="r1" value="Country1" onclick="c(this.value)">India
<input type="radio" name="r1" value="Country2" onclick="c(this.value)">US
SVCP/TYCM Page 11
CSS-(22519) Code that changes option list dynamically on radio button selection
SVCP/TYCM Page 12
CSS-(22519) Code that changes option list dynamically on radio button selection
We studied Arrays, Functions, & form elements and why they are used.
We also learnt about the different events and there use in form elements as attribute.
The application of this micro project is that we can utilize the code to generate dynamically
changing option list.
SVCP/TYCM Page 13