QuestionQuestion

Transcribed TextTranscribed Text

1. Add input validation such that the proper error is generated when the input fields are not integers. Rename to exam41v2.html function isInteger(id) { var flag=true; var x=document.getElementById(id); if (x.value==null || x.value=="") { alert("Integer Field Empty");flag=false;} else if (x.value==" ") { alert("Space is not Valid"); flag=false;} else if (isNaN(x.value)) { alert("Value Not A Number") flag=false;} else if ((parseFloat(x.value))%1 !=0 ) { alert("Value Is Not An Integer");flag=false;} return flag; } Input File: gradejs.html Output File: exam41v2.html 2. Add onfocus functionality to the input fields stating “Enter Number”. Rename to exam42v2.html Input File: exam41v2.html Output File: exam42v2.html 3. Convert the JavaScript code from #2 to be in object format instead. Rename to exam43v2.html Input File: exam42v2.html Output File: exam43v2.html 4. Modify the application from #3 to use DOM addEventListener. Rename to exam44v2.html Input File: exam43v2.html Output File: exam44v2.html 5. Change the application from #4 to dynamically display the form using DOM innerHTML. Rename to exam45v2.html Input File: exam44v2.html Output File: exam45v2.html

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

function calcaverage()
{
var ave = document.getElementById("ave");
var mid = document.getElementById("mid");
var fin = document.getElementById("fin");
var proj = document.getElementById("proj");
var ave = document.getElementById("ave");
ave.value = (parseInt(mid.value)+parseInt(fin.value)+parseInt(proj.value))/3;
}

function isInteger(id)
{
var elem=document.getElementById(id);
var value="";
var check = false;

if(elem.value !=null)
value=elem.value.trim();

if ((parseFloat(value))%1==0)
check = true;
else
alert("Number Is Not An Integer")
return check;
}


function calcletter()
{
var ave = document.getElementById("ave");
var mid = document.getElementById("mid");
var fin = document.getElementById("fin");
var proj = document.getElementById("proj");
var letter = document.getElementById('letter');...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$50.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Web Development (HTML, XML, PHP, JavaScript, Adobe, Flash, etc.) Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats