Download presentation
Presentation is loading. Please wait.
1
Form Components and Elements
First Name Address #1 Address #2 City Last Name Country State Zip Item Purchased Purchase Date Home Business Government Educational Institution Netware Banyan Vines Windows IBM Lan Server Comments?: Send Registration Cancel Serial Number Used For (check one) Network Operating System (check all that apply) Religious or Charitable Institution PC/NFS text box drop-down list box radio buttons check boxes text area form button group box This figure shows a form that contains various control elements commonly used in Web page forms.
2
Input boxes Accept user inputs (~ form fields) Text (default) Password
Radio (one selection only) Checkbox (multiple selection is allowed) Selection list Text Area
3
Input boxes Perform actions Submit Reset Button Others Hidden
4
Form objects 1. Input text box document.form_name.field_name
e.g., document.Registration.FirstName Properties: value: what is being entered? value.length: how many characters are being entered? Methods: indexOf(“character): returns the relative location of the character within the text entered Events: focus(): moving the cursor into the field Event handlers: onBlur: when the user left the field
5
Form objects 2. Selection list document.form_name.field_name
e.g., document.Registration.State Properties: selectedIndex: the index value of the currently selected option in the list (starts with 0) options[index].value: returns the value property of an option in a selection list options[index].text: returns the text (shown to the user) in a selection list
6
Form objects 3. checkboxes e.g., document.Registration.brkfst
document.form_name.field_name e.g., document.Registration.brkfst Properties: checked: returns true if the checkbox is selected else returns false
7
Form objects 4. Radio button e.g., document.Registration.meal[0]
document.form_name.field_name[index] e.g., document.Registration.meal[0] Properties: checked: returns true if the button is selected else returns false
8
Form objects 5. Input button 6. Entire form Event handler: onClick
onSubmit
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.