form_textfield

Versions
4.6
form_textfield($title, $name, $value, $size, $maxlength, $description = NULL, $attributes = NULL, $required = FALSE)

Format a single-line text field.

Parameters

$title The label for the text field.

$name The internal name used to refer to the field.

$value The initial value for the field at page load time.

$size A measure of the visible size of the field (passed directly to HTML).

$maxlength The maximum number of characters that may be entered in the field.

$description Explanatory text to display after the form item.

$attributes An associative array of HTML attributes to add to the form item.

$required Whether the user must enter some text in the field.

Return value

A themed HTML string representing the field.

Related topics

▾ 50 functions call form_textfield()

aggregator_form_category in modules/aggregator.module
aggregator_form_feed in modules/aggregator.module
block_box_form in modules/block.module
book_admin_view_line in modules/book.module
comment_admin_edit in modules/comment.module
Menu callback; edit a comment from the administrative interface.
comment_matrix_settings in modules/comment.module
Menu callback; presents the moderation vote matrix.
comment_role_settings in modules/comment.module
Menu callback; allows admin to set default scores for different roles.
comment_threshold_settings in modules/comment.module
Menu callback; displays settings for thresholds at which comments are displayed.
comment_vote_settings in modules/comment.module
Menu callback; displays page for assigning names to vote values.
contact_mail_user in modules/contact.module
drupal_settings in modules/drupal.module
Implementation of hook_settings().
filter_admin_overview in modules/filter.module
Menu callback; allows administrators to set up input formats.
filter_example_filter in developer/examples/filter_example.module
Implementation of hook_filter().
forum_admin_configure in modules/forum.module
Implementation of hook_settings
forum_form_container in modules/forum.module
Returns a form for adding a container to the forum vocabulary
forum_form_forum in modules/forum.module
Returns a form for adding a forum to the forum vocabulary
hook_form in developer/hooks/node.php
Display a node editing form.
hook_settings in developer/hooks/core.php
Declare administrative settings for a module.
menu_edit_item_form in modules/menu.module
Present the menu item editing form.
node_example_form in developer/examples/node_example.module
Implementation of hook_form().
node_form in modules/node.module
Generate the node editing form.
path_form in modules/path.module
Return a form for editing or creating an individual URL alias.
path_nodeapi in modules/path.module
Implementation of hook_nodeapi().
poll_form in modules/poll.module
Implementation of hook_form().
profile_form_profile in modules/profile.module
search_admin in modules/search.module
Menu callback; displays the search module settings page.
search_form in modules/search.module
Render a search form.
system_theme_settings in modules/system.module
Menu callback; display theme configuration for entire site and individual themes.
system_view_general in modules/system.module
taxonomy_form_term in modules/taxonomy.module
taxonomy_form_vocabulary in modules/taxonomy.module
theme_comment_form in modules/comment.module
throttle_settings in modules/throttle.module
Implementation of hook_settings().
upload_admin in modules/upload.module
user_admin_access_check in modules/user.module
Menu callback: check an access rule
user_admin_create in modules/user.module
user_admin_role in modules/user.module
Menu callback: administer roles.
user_block in modules/user.module
Implementation of hook_block().
user_configure_settings in modules/user.module
user_edit_form in modules/user.module
user_login in modules/user.module
user_pass in modules/user.module
user_register in modules/user.module
_filter_html_settings in modules/filter.module
Settings for the HTML filter.
_locale_admin_manage_add_screen in includes/locale.inc
User interface for the language addition screen
_locale_admin_manage_screen in includes/locale.inc
User interface for the language management screen
_locale_string_edit in includes/locale.inc
User interface for string editing
_locale_string_seek_form in includes/locale.inc
User interface for the string search screen
_profile_field_form in modules/profile.module
_user_admin_access_form in modules/user.module

Code

includes/common.inc, line 1222

<?php
function form_textfield($title, $name, $value, $size, $maxlength, $description = NULL, $attributes = NULL, $required = FALSE) {
  $size = $size ? ' size="'. $size .'"' : '';
  return theme('form_element', $title, '<input type="text" maxlength="'. $maxlength .'" class="'. _form_get_class('form-text', $required, _form_get_error($name)) .'" name="edit['. $name .']" id="edit-'. $name .'"'. $size .' value="'. check_plain($value) .'"'. drupal_attributes($attributes) .' />', $description, 'edit-'. $name, $required, _form_get_error($name));
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.