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

Java Script

The document is an HTML form for employee registration that collects personal and salary-related information. It includes fields for first name, last name, gender, address, department, and various salary components such as basic salary, HRA, DA, and PF. Upon submission, the form calculates the total salary and displays the entered information on the page.

Uploaded by

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

Java Script

The document is an HTML form for employee registration that collects personal and salary-related information. It includes fields for first name, last name, gender, address, department, and various salary components such as basic salary, HRA, DA, and PF. Upon submission, the form calculates the total salary and displays the entered information on the page.

Uploaded by

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

<html> var

dept=document.getElementById("dept").value;
<head><title>employee registration
form</title></head> var
basic=document.getElementById("basic").value;
<body>j
var
<script> hra=document.getElementById("hra").value;
function employee() var
{ da=document.getElementById("da").value;

var gender; var


pf=document.getElementById("pf").value;
var totsal=0;
var
var hraamt=(hra/100*basic);
fname=document.getElementById("fname").val
ue; var
daamt=(da/100*basic);
var
lname=document.getElementById("lname").val var
ue; pfamt=(pf/100*basic);

totsal=Number(basic)
+Number(hraamt)+Number(daamt)-
if(document.getElementById("gnd").checked==t Number(pfamt);
rue)

{ document.write("Name:"+fname+"
"+lname+"<br>");

gender="male";

} document.write("Gender:"+gender+"<br>");

else

{
document.write("Address:"+adr+"<br>");

gender="female";

var
adr=document.getElementById("adr").value;
<form name="frm" id="frm"
action="post">

<div>
document.write("Department:"+dept+"<br>");
First Name:<input id="fname"
document.write("Salary name="fname" type="text"><br><br>
Details"+"<br>");

document.write("Basic:"+basic+"<br>"); Last Name:<input id="lname"


name="lname" type="text"><br><br>

document.write("HRA:"+hra+"%of
Basic="+hraamt+"<br>"); Gender:<input type="radio"
id="gnd" name="gnd" value="male"
document.write("DA :"+da+"%of checked>male&nbsp&nbsp
Basic="+daamt+"<br>");

<input type="radio" id="gnd"


document.write("PF :"+pf+"%of name="gnd" value="female"
Basic="+pfamt+"<br>"); checked>female<br>
document.write("Total
salary:"+totsal+"<br><br>");
Address:<input id="adr"
type="textarea" name="adr"
size="100"><br><br>
document.write("************************
**********");

Department:<select id="dept"
name="dept">
}
<option
value="finance">Finance</option>
</script> <option
value="Management">Management</option>

<h1><ul><b>Employee <option
Registration Form</b></ul></b> value="sales">Sales</option>

<option
value="Security">Security</option>
</select> </body>

</html>

<br>

<br>

Basic Salary:<input id="basic"


step="0.01" name="basic" type="number"
value="0.00" size="10">

<br>

HRA(% of basic):<input id="hra"


step"0.01" name="hra" type="number"
value="0.00" min="0" max="50" size="7">

<br><br>

DA(% of basic):<input id="da"


step"0.01" name="da" type="number"
value="0.00" min="0" max="26" size="7">

<br><br>

pf(% of basic):<input id="pf"


step"0.01" name="pf" type="number"
value="0.00" min="0" max="10" size="7">

<br><br>

</div>

<input id="submit"
type="submit" onClick="employee()"
value="Show Report">

</form>

You might also like