AP Notes, Outlines, Study Guides, Vocabulary, Practice Exams and more!

Form Generation (Drupal 7 API) Flashcards

Functions to enable the processing and display of HTML forms.
Drupal uses these functions to achieve consistency in its form processing and presentation, while simplifying code and reducing the amount of HTML that must be explicitly generated by modules.

Terms : Hide Images
146781863date_validateValidates the date type to stop dates like February 30, 2006.
146781864drupal_build_formBuild and process a form based on a form id.
146781865drupal_form_submitRetrieves, populates, and processes a form.
146781866drupal_get_formWrapper for drupal_build_form() for use when $form_state is not needed.
146781867drupal_prepare_formPrepares a structured form array by adding required elements, executing any hook_form_alter functions, and optionally inserting a validation token to prevent tampering.
146781868drupal_process_formProcesses a form submission.
146781869drupal_rebuild_formConstructs a new $form from the information in $form_state.
146781870drupal_redirect_formRedirects the user to a URL after a form has been processed.
146781871drupal_retrieve_formRetrieves the structured array that defines a given form.
146781872drupal_validate_formValidates user-submitted form data from the $form_state using the validate functions defined in a structured form array.
146781873form_builderWalk through the structured form array, adding any required properties to each element and mapping the incoming input data to the proper elements. Also, execute any #process handlers attached to a specific element.
146781874form_clear_errorClear all errors against all form elements made by form_set_error().
146781875form_errorFlag an element as having an error.
146781876form_execute_handlersA helper function used to execute custom validation and submission handlers for a given form. Button-specific handlers are checked first. If none exist, the function falls back to form-level handlers.
146781877form_get_cacheFetch a form from cache.
146781878form_get_errorReturns the error message filed against the given form element.
146781879form_get_errorsReturn an associative array of all errors.
146781880form_get_optionsTraverses a select element's #option array looking for any values that hold the given key. Returns an array of indexes that match.
146781881form_load_includeLoads an include file and makes sure it is loaded whenever the form is processed.
146781882form_options_flattenAllows PHP array processing of multiple select options with the same value.
146781883form_pre_render_conditional_form_elementAdd form_element theming to an element if title or description is set.
146781884form_pre_render_fieldsetAdds members of this group as actual elements for rendering.
146781885form_process_actionsProcesses a form actions container element.
146781886form_process_checkboxSets the #checked property of a checkbox element.
146781887form_process_checkboxes...
146781888form_process_containerProcesses a container element.
146781889form_process_dateRoll out a single date element.
146781890form_process_fieldsetAdds fieldsets to the specified group or adds group members to this fieldset.
146781891form_process_machine_nameProcesses a machine-readable name form element.
146781892form_process_password_confirmExpand a password_confirm field into two text boxes.
146781893form_process_radiosRoll out a single radios element to a list of radios, using the options array as index.
146781894form_process_selectProcesses a select list form element.
146781895form_process_tableselectCreate the correct amount of checkbox or radio elements to populate the table.
146781896form_process_vertical_tabsCreates a group formatted as vertical tabs.
146781897form_process_weightExpand weight elements into selects.
146781898form_select_optionsConverts a select form element's options array into an HTML.
146781899form_set_cacheStore a form in the cache.
146781900form_set_errorFiles an error against a form element.
146781901form_set_valueChange submitted form values during form validation.
146781902form_state_defaultsRetrieve default values for the $form_state array.
146781903form_state_keys_no_cacheReturns an array of $form_state keys that shouldn't be cached.
146781904form_state_values_cleanRemoves internal Form API elements and buttons from submitted form values.
146781905form_type_checkboxes_valueHelper function to determine the value for a checkboxes form element.
146781906form_type_checkbox_valueHelper function to determine the value for a checkbox form element.
146781907form_type_image_button_valueHelper function to determine the value for an image button form element.
146781908form_type_password_confirm_valueHelper function to determine the value for a password_confirm form element.
146781909form_type_select_valueHelper function to determine the value for a select form element.
146781910form_type_tableselect_valueHelper function to determine the value for a tableselect form element.
146781911form_type_textfield_valueHelper function to determine the value for a textfield form element.
146781912form_type_token_valueHelper function to determine the value for form's token value.
146781913form_validate_machine_nameForm element validation handler for #type 'machine_name'.
146781914map_monthHelper function for usage with drupal_map_assoc to display month names.
146781915password_confirm_validateValidate password_confirm element.
146781916theme_buttonReturns HTML for a button form element.
146781917theme_checkboxReturns HTML for a checkbox form element.
146781918theme_checkboxesReturns HTML for a set of checkbox form elements.
146781919theme_containerReturns HTML to wrap child elements in a container.
146781920theme_dateReturns HTML for a date selection form element.
146781921theme_fieldsetReturns HTML for a fieldset form element and its children.
146781922theme_fileReturns HTML for a file upload form element.
146781923theme_formReturns HTML for a form.
146781924theme_form_elementReturns HTML for a form element.
146781925theme_form_element_labelReturns HTML for a form element label and required marker.
146781926theme_form_required_markerReturns HTML for a marker for required form elements.
146781927theme_hiddenReturns HTML for a hidden form element.
146781928theme_image_buttonReturns HTML for an image button form element.
146781929theme_passwordReturns HTML for a password form element.
146781930theme_radioReturns HTML for a radio button form element.
146781931theme_radiosReturns HTML for a set of radio button form elements.
146781932theme_selectReturns HTML for a select form element.
146781933theme_submitReturns HTML for a submit button form element.
146781934theme_tableselectReturns HTML for a table with radio buttons or checkboxes.
146781935theme_textareaReturns HTML for a textarea form element.
146781936theme_textfieldReturns HTML for a textfield form element.
146781937theme_vertical_tabsReturns HTML for an element's children fieldsets as vertical tabs.
146781938weight_valueIf no default value is set for weight select boxes, use 0.
146781939_form_builder_handle_input_elementPopulate the #value and #name properties of input elements so they can be processed and rendered.
146781940_form_button_was_clickedHelper function to handle the convoluted logic of button click detection.
146781941_form_element_triggered_scripted_submissionHelper function to handle the convoluted logic of button click detection.
146781942_form_options_flattenHelper function for form_options_flatten().
146781943_form_set_classSets a form element's class attribute.
146781944_form_validatePerforms validation on form elements. First ensures required fields are completed, #maxlength is not exceeded, and selected options were in the list of options given to the user. Then calls user-defined validators.

Need Help?

We hope your visit has been a productive one. If you're having any problems, or would like to give some feedback, we'd love to hear from you.

For general help, questions, and suggestions, try our dedicated support forums.

If you need to contact the Course-Notes.Org web experience team, please use our contact form.

Need Notes?

While we strive to provide the most comprehensive notes for as many high school textbooks as possible, there are certainly going to be some that we miss. Drop us a note and let us know which textbooks you need. Be sure to include which edition of the textbook you are using! If we see enough demand, we'll do whatever we can to get those notes up on the site for you!