Join Joe Marini for an in-depth discussion in this video Retrieving form element values with $F(), part of Prototype and script.aculo.us Essential Training.
- View Offline
- Exercise Files
Continuing with the hit parade of retrieving content from the document using…the dollar selectors, let's take a look at the $F() selector.…This is tailor-made for getting information out of web forms that are in your pages.…So it returns the values from form elements in a manner that is predictable and…consistent across browsers, because there are some cross-browser quirks the way…that form values are returned and the $F() selector smooths those out.…
So the way works is this.…For multiple-selection elements like list boxes, you get back an array of values.…That is one entry for each selected option.…Otherwise, for single elements, it just returns a single value.…Now, for option tags that are in list boxes that don't have a value…attribute, which that may be the case, what happens is the text content of…the option tag itself is returned.…So ordinarily, you would attach a value attribute to each option tags saying,…hey, this is the value that I should use internally for this option.…
But if you don't do that, the text itself is used instead.…
- Retrieving and manipulating web page elements
- Handling web page events and creating custom events
- Traversing the DOM
- Creating and handling AJAX requests
- Using script.aculo.us controls such as Autocompleters, Sliders, and Visual Effects
- Building complex page features like data filtering and image rotators
Skill Level Beginner
1. Overview of Prototype
Introducing Prototype4m 59s
2. Retrieving Page Content
4. Working with Collections
5. Using Prototype's DOM Features
6. Working with Events
7. Prototype and AJAX
8. script.aculo.us and Prototype UI
9. Putting It All Together
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.