Validation and event handling in javascrip

Assignment Help JAVA Programming
Reference no: EM13761825

Purpose: You are going to learn basic form validation and event handling in JavaScript.

Requirements: To complete this project you will write and submit one HTML file containing embedded CSS and JavaScript. The file will be called lab2.html. This file contains a registration form, which can be styled any way you like subject to the requirements below. This file must be an ASCII file (i.e. a plain text document with a .html extension). You may create it with any editor but you must ensure that it is a text file. In other words, it should not contain anything except ASCII characters (including HTML tags/CSS rules/JavaScript and
content).

YOU MAY USE A WYSIWYG EDITOR! This editor can be used to generate the HTML markup of your document. Any CSS or JavaScript must be subsequently added to this file by hand (i.e. manually editing the HTML file). This lab will be a simple registration form. Every visible form input should be labeled with explanatory text. The form should have the following inputs:

• First and last name (2 separate text fields)
o The user should enter only letters in each field, with the first letter capitalized
• Student ID number (a text field)
o The user should enter a 9 digit number
• Biography (a textarea)
o The user may enter up to 25 words
• Calculator
o The calculator should have a text field where result is displayed  If the user types in the text field, as long as the result is numeric, it can be used - (typing in the text field clears previous contents) If the user types non-numeric data in the text field, when the user presses any button, the text field should change to "ERROR: press C"

The calculator should have 18 buttons (of button input type) 0-9 buttons, laid out any way you like

  •  These start a new number with the corresponding digit value if no number has been entered yet, or append the corresponding digit value to a number C button, which clears the result text field, and current calculated result, leaving the result text field blank
  •  = button, which performs the last operation pressed and generates a new result in the result text field
  •  +, -, /, and * buttons, which append the corresponding operation to the expression
  • a button labeled << which shifts the current calculator result to the left (examples: 12345 becomes 23450. 2468 becomes 4680. 0 becomes 0.)
  •  a button labeled >> which shifts the current calculator result to the right (examples: 12345 becomes 1234. 2468 becomes 246. 0 becomes 0.)

The following examples demonstrate exactly how the calculator should behave. Do not deviate from this behavior, nor display any additional characters nor expressions in the

result field.

  •  EXAMPLE

• User presses 2 button (2 is displayed in result)
• User presses + button
• User presses 4 button (4 is displayed in result)
• User presses = button (6 is displayed in result)

  •  EXAMPLE

• User presses C to clear display
• User presses 2 button (2 is displayed in result)
• User presses 4 button (24 is displayed in result)
• User presses / button
• User presses 3 button (3 is displayed in result)
• User presses = button (8 is displayed in result)

  •  EXAMPLE

• User presses C to clear display
• User presses 2 button (2 is displayed in result)
• User presses 4 button (24 is displayed in result)
• User presses / button
• User presses 1 button (1 is displayed in result)
• User presses 2 button (12 is displayed in result)
• User presses = button (2 is displayed in result)

  •  EXAMPLE

• User presses C to clear display
• User types 24 in result field (24 is displayed in result)
• User presses / button
• User presses 1 button (1 is displayed in result)
• User presses 2 button (12 is displayed in result)
• User presses = button (2 is displayed in result)

  •  EXAMPLE

• User presses C to clear display
• User types 24h in result field (24h is displayed in result)
• User presses / button ("ERROR: press C" is displayed in result)
o User must press C to clear result

Reference no: EM13761825

Questions Cloud

Auditor role and responsibilities : Compare the primary auditor objectives in auditing historical financial statements to auditing internal controls over financial reporting. Identify at least two (2) objectives that are the most significant in reducing the risk of reporting errors ..
List all of the variables that you will use : List all of the variables that you will use (use valid variable names). Indicate whether the data type is string, integer, or double, and so on
Determine the medium through which the office staff prefers : Determine the medium through which the office staff prefers to communicate, wether it is a presentation, e-mail or a printed presentation.
Concept of double taxation : 1. Please describe the concept of "double taxation" and discuss which entity(ies) are subject to this type of taxation.
Validation and event handling in javascrip : To complete this project you will write and submit one HTML file containing embedded CSS and JavaScript. The file will be called lab2.html. This file contains a registration form, which can be styled any way you like subject to the requirements be..
Diffusion innovation model : The general health promotion proposal (DIABETES REDUCTION).
Information security profile for your organization : Submit an Information Security Profile for your organization. This project requires you to summarize the required controls and describe the security posture of your organization based on its selected Information security standard
What moral would the people draw from the zuni prayer : Which fable is most applicable to your life, and how? What moral would the people draw from the Zuni prayer? What is the foggiest point in the lecture or reading? Explain why and how so!
What is the estimated amount of time for implementation : Determine the medium through which the office staff prefers to communicate, wether it is a presentation, e-mail or a printed presentation. Knowing my audience will help me to understand their specific needs and not just the message that I want to ..

Reviews

Write a Review

 

JAVA Programming Questions & Answers

  Compute the fifties and the remaining amount

Prompt the user for a string input value for the amount in dollars and store it in a variable named input and convert the string to an integer and store it in the variable named amount.

  When the user presses a button

When the user presses a button, get the text from text field. Now extract the words from the text one at a time and find the largest word of length 4 or more. Let's call this largest word X for now. In response, create a question based on the length ..

  Produce a java implementation of the gui

For your Assignment 2 Part 1 submission you are required to produce a Java implementation of the GUI for the Agriculture image viewer component of your overall Agriculture File Storing and Management (FSM) System.

  Write a script that simulates a casino machine

Write a script that simulates a casino machine. To play a single round on the machine user pays $ 5. Now when the user start the machine, the machine rolls a pair of dice

  Write java program to evaluate postfix expressions

Write a java program to evaluate postfix expressions containing complex numbers using a stack. This program should contain two classes.

  Have an array of integers with user input instead of given

change the current code to have an array of integers with user input intead of given input from the main where it says int[] a=....; And also from a text file but the same numbers as what is given in main.

  Development of a simple program involving multiple classes

Development of a Simple Program Involving Multiple Classes and development of a basic Class, development of the Country and World classes

  Implement the application using a singly linked list

Implement the following application using a singly linked list. This application accepts from console and stores a list of 10 names of your friends in the singly linked list

  Write java program that writes names to text file

Create an empty text file called myfile.txt. Write a Java program that writes your names to the text file created. If the file does not exist, include an exception handler for that error.

  You need to train for 10 weeks

You are preparing for a marathon. In order to prepare, you need to train for 10 weeks, running an increasing number of miles per week, starting at running at least 2 miles your first week up to 26 miles by week 10.

  Write a program that prints a payroll statement

Write a program that accepts the subsequent information from the user and prints a payroll statement:

  Write down several reasons why exception-handling

question 1 give several reasons why exception-handling techniques should not be used for conventional program

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd