JavaScript for Web Form Handling, Exams of Social Sciences

Various aspects of javascript used for web form handling, including form organization, form element manipulation, form validation, and regular expressions. It discusses topics such as accessing form elements, handling user events, working with selection lists, formatting numeric values, and using the constraint validation api. The document also covers the syntax and usage of javascript constructs like loops, conditional statements, and event handling. Overall, this document provides a comprehensive overview of the javascript capabilities and techniques employed in creating interactive and responsive web forms.

Typology: Exams

2023/2024

Available from 10/19/2024

ROCKY-B
ROCKY-B 🇰🇪

4.4

(16)

40K documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ISDS FINAL 13, LSU ISDS 3105 FINAL EXAM
Since a page can contain multiple web forms, JavaScript organizes the forms into
_____ object collection. - Answers-document.forms[idref]
Which of the following expressions can be used to reference a form element using its
name or id attribute? - Answers-form.elements.ename;
Identify the input field property or method that can be used to remove the focus from the
input box.
a. input.focus()
b. input.pattern
c. input.blur()
d. input.required - Answers-input.blur()
Identify the input field property or method that can be used to return the current value
displayed in the input box. - Answers-input.value
Which of the following selection list properties returns true if more than one option can
be selected from the list? - Answers-select.multiple
_____ is a selection list property that returns the number of options displayed in the
selection list. - Answers-select.size
Identify the options object collection in which the selection list options are organized. -
Answers-select.options[idref]
Identify the toLocaleString() method that gives you more control while formatting
numeric values. - Answers-value.toLocaleString(locale, {options})
Which of the following descriptions corresponds to the currency:code option from the
toLocaleString() method? - Answers-Currency symbol to use for currency formatting
where code designates the country or language
The _____ option from the toLocaleString() method indicates whether to use a
thousands grouping symbol (true) or not (false). - Answers-useGroup: Boolean
For options buttons and check boxes, use the _____ event handler in response to the
user clicking those elements. - Answers-onclick
In many web forms, important data is stored within _____ so that the data is available to
programmers but removed from the user's control. - Answers-hidden fields
Identify the reason for which <form method="get" action="url"> attribute is added to a
form element. - Answers-To append form data to the URL
pf3
pf4
pf5
pf8

Partial preview of the text

Download JavaScript for Web Form Handling and more Exams Social Sciences in PDF only on Docsity!

ISDS FINAL 13, LSU ISDS 3105 FINAL EXAM

Since a page can contain multiple web forms, JavaScript organizes the forms into _____ object collection. - Answers-document.forms[idref] Which of the following expressions can be used to reference a form element using its name or id attribute? - Answers-form.elements.ename; Identify the input field property or method that can be used to remove the focus from the input box. a. input.focus() b. input.pattern c. input.blur() d. input.required - Answers-input.blur() Identify the input field property or method that can be used to return the current value displayed in the input box. - Answers-input.value Which of the following selection list properties returns true if more than one option can be selected from the list? - Answers-select.multiple _____ is a selection list property that returns the number of options displayed in the selection list. - Answers-select.size Identify the options object collection in which the selection list options are organized. - Answers-select.options[idref] Identify the toLocaleString() method that gives you more control while formatting numeric values. - Answers-value.toLocaleString(locale, {options}) Which of the following descriptions corresponds to the currency:code option from the toLocaleString() method? - Answers-Currency symbol to use for currency formatting where code designates the country or language The _____ option from the toLocaleString() method indicates whether to use a thousands grouping symbol (true) or not (false). - Answers-useGroup: Boolean For options buttons and check boxes, use the _____ event handler in response to the user clicking those elements. - Answers-onclick In many web forms, important data is stored within _____ so that the data is available to programmers but removed from the user's control. - Answers-hidden fields Identify the reason for which

attribute is added to a form element. - Answers-To append form data to the URL

Using the _____, you can direct the browser to retrieve specific information about the URL, to reload the current page, or to load an entirely new page. - Answers-location object Identify the method associated with browser locations that can find the protocol, hostname, and port number of the URL. - Answers-location.origin Which of the following location methods returns the href portion of the location's URL? - Answers-location.toString() Identify the description of the option.selected property. - Answers-It returns true if the option has been selected by user. Radio buttons are grouped by a common field name placed within the _____ array. - Answers-options[idref] The _____ property returns a Boolean value indicating whether the option button, option, is currently checked by a user. - Answers-option.checked Which of the following CSS selector returns the option button that is checked within the protection field? - Answers-input[name="protection"]:checked Identify the object constructor that can be used to create a text string explicitly. - Answers-stringVar = new String(var); Which of the following methods can be used to reference a character at the index i of the string? - Answers-string.charAt(I) Which of the following methods can be used to extract longer text strings? - Answers- string.slice(start [,end]) Identify the method that can be used to create an array of substrings. - Answers- strArray = string.split(str) Identify the use of string.indexOf(str [,start])method. - Answers-To search for the occurrence of a substring within larger text strings Regular expressions have the general form denoted as _____. - Answers-/pattern/ Identify the action for which the g flag is added at the end of the regular expression /pattern/. - Answers-To perform a global search Identify the description for the \b character type. - Answers-A word boundary Which of the following character types is used for any non-white-space character? - Answers-\S

Which of the following methods should Lisa use to format the numbers as currency? - Answers-toLocaleString() If Lisa uses minimumIntegerDigits: num method, which of the following is the correct range for num? - Answers-1 to 21 Thomas is working on reference forms and form fields. He wants to use event handlers that can respond to user actions within a form. He uses the element.onchange event handler. Identify the description of the event handler Thomas has used. - Answers-The value of element has been modified Which event handler should Thomas use for options buttons and check boxes in response to the user clicking those elements? - Answers-element.onclick Samantha is working on a web document. She wants to direct the browser to retrieve specific information about a URL, to reload the current page, and to load an entirely new page. Identify the object that Samantha should use to meet her desired requirements. - Answers-location Which of the following commands can Samantha use to load a new page in the current window? - Answers-window.location = url William is exploring the syntax of regular expressions. He learns that in the regular expression language, a word refers to any string of symbols consisting solely of word characters. He also learns that word boundaries are indicated by the \b symbol. He wants to use a pattern that matches any word that starts with the characters "great" such as "greater", "greatness", or "greatest" Which of the following patterns should William use? - Answers-/\bgreat/ Which of the following patterns should William use to match any word that ends with "ust" such as "dust", "trust", or "must"? - Answers-/ust\b/ A _____ is created using the select and option elements that present users with a group of predefined possible values for the data field. - Answers-selection list Every field set must contain the _____ element, which should have only text and no nested elements for describing its content. - Answers-legend get and post are two possible values for the _____ attribute. - Answers-method

Identify a syntax that displays a selection list as a scroll box with 5 options visible in the web form. - Answers- Identify a widget that allows the user to interact with the form for entering numeric values confined to a specified range. - Answers-Slider control Identify an attribute that can be added to the input element to validate a text value against a regular expression. - Answers-pattern="regex" Identify the type of control that performs an action. - Answers-A form button Which of the following is true of field sets? - Answers-Field sets act like block elements that can expand to accommodate their content. In the accompanying figure, Box B points to _____. - Answers-option buttons In the accompanying figure, Box E represents a _____. - Answers-Spin box A _____ is any group of characters enclosed within either double or single quotation marks in JavaScript. - Answers-text string Identify a statement that is added to the first line of the file to run a script in strict mode.

  • Answers-"use strict"; JavaScript is used as a programming tool for: - Answers-creating interactive web forms and animated graphics. A command that indicates an action for the browser to take should end with a _____. - Answers-semicolon A _____ occurs after a script has been successfully loaded with no syntax errors and is being executed by a browser. - Answers-run-time error A _____ is a collection of commands that performs an action or returns a value. - Answers-function A _____ is a named item in a program that stores a data value, such as a number or text string, or an object, such as a part of the web browser or browser window. - Answers-variable The _____ attribute can be applied to the script element to ensure that an object can be referenced within a JavaScript program that runs only after the page has completed loading. - Answers-defer _____ programming distributes the load to prevent a server from getting overloaded with program-related requests. - Answers-Client-side

The ______ object property references the browser window in which the event has occurred. - Answers-evt.view Which of the following event properties or methods returns a Boolean value that indicates whether an event can have its default action terminated? - Answers- evt.cancelable which of the following provides the correct syntax for adding an event handler to a page element as an HTML attribute? - Answers- The ______ event handler is applied to a page when it is about to be unloaded by the browser. - Answers-onbeforeunload Which of the following is the correct location of a key on a keyboard if the value of the keyboard property evt.location is 3? - Answers-The key is located on the numeric pad. Which of the following is the syntax to define a cursor in JavaScript? - Answers- object.style.cursor = cursorTypes; Which of the following JavaScript expressions is equivalent to the given HTML code?