Question & Answer: Question The task is to write a JavaSeript code that can build a dynamic webpage content. Please allow the user to:…..

Assignmeht Deadline: 14 August 2017
Question The task is to write a JavaSeript code that can build a dynamic webpage content. Please allow the user to:
1. Select any html element and place it in the webpage
2. Choose the attributes
3. Change the content of the element (depends on the element)
4. Choose the element’s position.
5. Edit the element after being added to the page.
6. Build a form and with some elements
7. Add event listeners for any elements
The JavaScript code then change the content of the webpage accordingly.
I need an answer for this question before 14/8
There should be 2 files :
Html file and Java script file to run the page as given in the question
Please don’t write the answer on a paper
Write it here as a text for both files the html and js file so i can copy and paste it to run the wep page .
Make sure it runs perfectly before posting the answer
Thanks

Expert Answer

 

file.html

<html>
<head>
<title>Employee Registration Form</title>
<script type=”text/javascript” src=”mine.js”></script>
</head>
<body bgcolor=”#FFFFFF”>
<form name=”employee” action=”” onsubmit=”return valid();” method=”post”>
<table align=”center” width=40% width=”100%” cellspacing=”2″ cellpadding=”2″ border=”5″>
<tr>
<td colspan=”2″ align=”center”><b>Employee Registration Form.</b></td>

</tr>
<tr>
<td align=”left” valign=”top” width=”41%”>Employee Name<span style=”color:red”>*</span></td>

<td width=”57%”><input type=”text” value=”” name=”emp_name” size=”24″></td>
</tr>
<tr>
<td align=”left” valign=”top” width=”41%”>Employee Number<span style=”color:red”>*</span></td>
<td width=”57%”>
<input type=”text” value=”” name=”num” onkeypress=”return isNoKey(event)” size=”24″></td>
</tr>
<tr>
<td align=”left” valign=”top” width=”41%”>Address</td>

<td width=”57%”><textarea rows=”4″ maxlen=”200″ name=”S2″ cols=”20″></textarea></td>
</tr <tr>

<td align=”left” valign=”top” width=”41%”>Contact Number</td>
<td width=”57%”>
<input type=”text” value=”” onkeypress=”return isNoKey(event)” name=”fName” size=”24″></td>
</tr>
<tr>
<td align=”left” valign=”top” width=”41%”>Job Location</td>
<td width=”57%”><select name=”dropDwn”>
<option value=”Select”>Select</option>
<option value=”Kashipur”>Kashipur</option>
<option value=”Almora”>Almora</option>
<option value=”Kashipur”>Mehra Gaav</option>
<option value=”Almora”>Mysore</option>
<option value=”Kashipur”>Bihar</option>

</select></td>

</tr>

<tr>
<td align=”left” valign=”top” width=”41%”>Designation</td>
<td width=”57%”>
<select name=”dropDwn”>
<option value=”Select”>Select</option>
<option value=”System Engg”>System Engg</option>
<option value=”Sen. System Engg”>Sen. System Engg</option>
<option value=”Data Analyst”>Data Analyst</option>
<option value=”Lead Techno”>Lead Techno</option>
<option value=”Project Man.”>Project Man.</option>
</select></td>
</tr>
<tr>
<td align=”left” valign=”top” width=”41%”>Email<span style=”color:red”>*</span></td>
<td width=”57%”>
<input type=”text” value=”” name=”email” size=”24″></td>
</tr>
<tr>
<td colspan=”2″>
<p align=”center”>
<input type=”submit” value=” Submit” name=”bb”>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=”reset” value=” Reset All ” name=”bb1″></td>
</tr>
</table>
</form>
</body>

</html>

mine.js

function valid() {
if (document.employee.emp_name.value == “”) {
alert(“Please fill in the ‘Your Employee Name’ box.”);
return false;
}
if (document.employee.num.value == “”) {
alert(“Enter Employee Number”);
return false;
}
alert(“sucessfully Submitted”);

if (!(/^w+([.-]?w+)*@w+([.-]?w+)*(.w{2,3})+$/).test(document.employee.email.value)) {
alert(“You have entered an invalid email address!”)
return (false)
}
}

function isNoKey(evt) {
var chCode = (evt.which) ? evt.which : event.keyCode;
if (chCode != 46 && chCode > 31 &&
(chCode < 48 || chCode > 57)) {
alert(“Enter Number”);
return false;
}
return true;
}

OUTPUT:

Still stressed from student homework?
Get quality assistance from academic writers!