Documente Academic
Documente Profesional
Documente Cultură
COMPUTER PROGRAMMING 3
(WEB PAGE DESIGN & DEVELOPMENT)
1 Prelim – Lesson 2
BASIC ELEMENT OF A
FORM
FORM TAG: <form></form>
2
-Allows user to enter free-form text information in an
open-minded edit field gives editable fields.
3
INPUT TAG:
Most flexible and the most complex and
produces lists of choices.
Text
Password
Radio
Reset
Submit
Variants:
Size- how many characters wide the text entry
field will be.
Maxlength- Maximum numbers of characters that
a user may enter into the field.
Value- maybe set to the default contents of the 4
field
Example:
<input type=“text” name=“a” size=20
maxlength=15>
<input type=“password” name=“pass” size=20
maxlength=15 value=“Password”>
<input type=“checkbox” name=“m”>Male
<input type=“checkbox” name=“f”>female
<input type=“radio” name=“w”
value=“wheat”>Wheat
<input type=“radio” name=“r” value=“rye”>Rye
<input type=“reset” value=“clear”>
<input type=“submit” value=“save”>
Checkbox- toggle that can be either on or off
5
STRING
Is more commonly referred to as text. It
contains a collection of different alpha –
numeric combination as well as punctuation. In
6
Javascript the string data type is used to
manage text contents of variables. It contains
methods and properties for better manipulation
of data.
METHOD DESCRIPTION
Anchor() Creates an HTML anchor
specified button
METHOD DESCRIPTION
indexOf() Returns the position of the first
occurrence of a specified string
value in a string
Italics() Display a string in italic
11
METHOD DESCRIPTION
Substr() Extracts a specified number of
characters in a string from a
start index
Substring() Extracts the characters in a
string between two specified
indices
Sup() Display a blinking string
an object
GETTING THE LENGTH OF THE
STRING
To get the length of a string, we
use the length property of the string
13
object. Properties are accessed by the
dot(.) operator
QUIZ / MACHINE PROBLEM
GOODLUCK!!!
14