Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CIS385 JAVASCRIPT FORM PROCESSOR GUIDELINE FOR CREATING A JS CLIENT-SIDE FORM PR

ID: 3703316 • Letter: C

Question

CIS385 JAVASCRIPT FORM PROCESSOR GUIDELINE FOR CREATING A JS CLIENT-SIDE FORM PROCESSOR 1. Give unique ID attributes for each of the textboxes contained in the form as follows FORM TEXTBOXES «input typertext. ?de'num' size#15"/> cinput type text' id 'ans size 15 b 2. Create JS onclick event handler by creating the fa JavaScript(JS) function as follows: JAVASCRIPT PROTOTYPE function incprob0 1. Get Text Value from TextBox1 by using the following DOM object method: document.getElementByldf'num) 2. Convert Text Value to float by using parseFloat0 3. Now use converted value to compute area. 4. Place Area value in TextBox2 by using the following DOM object method: document.getElementByld(ans) JAVASCRIPT ACTUAL CODE function incprob0 var TB10bject document getElementByld(num); var TB20bject document.getElementByld(ans): var num-parseFloat( TB10bject.value ) var ans num +1; TB20bject.value ans 3. Finally, link onclick event attribute within button1 to the incprob0 function as shown below: ATTRIBUTE SAMPLE onclick-"incprob0:" HTML ACTUAL CODE Kinput type button value INC" onclick-'incprob)

Explanation / Answer

here is your answer : ---------->>>>>>>>>

<!DOCTYPE html>
<html>
<head>
<title>INCREMENT PROBLEM</title>
</head>
<script type="text/javascript">
function incProb(){
  var obj1 = document.getElementById("num");
  var obj2 = document.getElementById("ans");

  var num = parseFloat(obj1.value);
  num = num + 1;

  obj2.value = num;
}
</script>
<body>
<p>Enter Number :-
<input type="text" name="number" id="num" ><br></p>
<p>Answer : -
<input type="text" name="answer" id="ans"><br></p>
<input type="button" name="Incr" value="Increment">

</body>
</html>